根据字段进行查询
select nickname from os_user where nickname = “biubiubiu”
查询os_user_account表中金额由大到小排名前三的用户的所有信息
select * from os_user_account order by balance desc limit 3
关联查询 在os_user表中与os_user_account表中查询nickname=“biubiubiu”的金额“blance”为多少?
SELECT os_user_account.balance from os_user_account INNER JOIN os_user ON os_user.Id=os_user_account.os_user_id WHERE os_user.nickname=‘biubiubiu’
关联查询
SELECT * FROM os_user_account where os_user_id in (SELECT id from os_user where nickname=‘那个伤’ or nickname=‘天亮’ )