MySql常用查询语句

根据字段进行查询
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=‘天亮’ )

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值