时间:2021-07-01 10:21:17 帮助过:2人阅读
select * from product limit 0,10 select * from product limit 10
2、like ‘%N%‘ : 模糊查询 查找出含有 ‘N’ 的数据
select * from product where product_name like ‘%饼%‘
3、in (‘x‘,‘y‘) : 查询指定字段为x或者y的数据
select * from product where warehouse in (‘二院店‘,‘农夫店‘)
4、between ‘x‘ and ‘y‘ :查询指定字段间于x,y之间的值 (这些值可以是数值、文本或者日期)
select * from storage where last_time between ‘1460937599‘ and ‘1460937601‘ /*在此范围的*/
select * from storage where last_time not between ‘1460937599‘ and ‘1460937601‘ /*不在此范围的*/
5、as : 组合查询 设置别名
select s.bar_code as bar_code,s.warehouse,s.num as stock,s.last_time,p.supplier from storage as s,product as p where s.bar_code = p.bar_code
6、join :与5相同的效果
select s.bar_code as bar_code,s.warehouse,s.num as stock,s.last_time,p.supplier from storage as s inner join product as p where s.bar_code = p.bar_code
7、
MySQL 学习
标签: