MySQL

来源:互联网 发布:杭州正规淘宝运营公司 编辑:程序博客网 时间:2024/06/05 01:05


普通查询
select * from students;
2. 根据查询条件查询(where ... and)
select * from students as stu WHERE 1=1 AND stu.name='Ijiran' ;
3. 模糊查询 (like '%')
select * from students as stu where 1=1 and stu.name LIKE '%jiran';
4.  排序查询(order by)
select * from students as stu where 1=1 ORDER BY stu.age desc;
5.  查询前n条记录(n为正整数)
select * from students as stu where 1=1 LIMIT 0,n ;
6.  查询后n条记录(n为正整数)
select * from students as stu where 1=1 LIMIT n ;
7.  查询从第(m)条开始的n条记录(n为正整数)
select * from students as stu where 1=1 LIMIT m-1,n ;

0 0
原创粉丝点击