帶in關頭字的調集查詢
只查詢ID為2,4,6的信息
select username from user where id in (2,4,6);
除了不查詢ID為2,4,6的信息外,其他的信息
select username from user where not id in (2,4,6);
查詢sex中開首為w的信息
select username,age from user where sex like 'w%';
查詢address中中心有u的信息,'_'的利用
select username,age from user where address like '_u%';
查詢address中含有a的信息
select username,age from user where address like '%a%';
按春秋排序
select*from user order by age asc;(升序)
select*from user order by age desc;(j降序)
limit的利用
限制查詢前5個信息
0 篇文章
如果覺得我的文章對您有用,請隨意打賞。你的支持將鼓勵我繼續創作!