mysql的一些语句总结


1 、select owner_email,email1 from acc_mas;  在acc_mas表里面查这两个字段的数据
2 、desc acc_mas;  可以查看所有的字段
3、select * from stk_mas where org_no =8002 and stk_c like '978%' limit 300,100      //以每页100条数据,此代表第三页的数据
4、select count(*) from stk_mas org_no=8002   //查出表内总数量
5、select * from stk_dtl,stk_mas where stk_dtl.stk_c=stk_mas.stk_c   //两个表联合查询 
6、GRANT ALL PRIVILEGES ON *.* TO 'user'@'%' IDENTIFIED BY 'test' WITH GRANT OPTION;  //建立一个可以远程访问的用户,用户名:user 密码:test   可以在mysql 里的user表里看到这个用户
7、select * from stk_mas where  stk_c like '978%' and stk_name like '%an%'  //'%an%'为谐音输入,'%'不支持谐音
8、select * from stk_wh where org_no =8002 and loc_no=1 and stk_qty>5 and stk_c in(select stk_c from stk_mas where org_no =8002)    //为两个表联合查询
9、select stk_mas.stk_c,stk_mas.stk_name,stk_wh.stk_qty from stk_wh,stk_mas where stk_wh.stk_c=stk_mas.stk_c      //同样为两个表联合查询

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值