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 //同样为两个表联合查询
mysql的一些语句总结
最新推荐文章于 2024-10-09 10:32:38 发布