手抄报 安全手抄报 手抄报内容 手抄报图片 英语手抄报 清明节手抄报 节约用水手抄报

MySQL中带in关键字的集合查询

时间:2024-10-13 23:20:33

1、只查询ID为2,4,6的信息select username from user where id in (2,4,6);

MySQL中带in关键字的集合查询

2、除了不查询ID为2,4,6的信息外,其他的信息select username from user where not id in (2,4,6);

MySQL中带in关键字的集合查询

3、查询sex中开头为w的信息select username,age from user where sex like 'w%';

MySQL中带in关键字的集合查询

4、查询address中中间有u的信息,'_'的使用select username,age from user where address like '_u%';查询address中含有a的信息select username,age from user where address like '%a%';

MySQL中带in关键字的集合查询
MySQL中带in关键字的集合查询

5、按年龄排序select*from user order by age asc;(升序)select*from user order by age desc;(j降序)

MySQL中带in关键字的集合查询
MySQL中带in关键字的集合查询

6、limit的使用限制查询前5个信息

MySQL中带in关键字的集合查询
© 手抄报圈