带in关头字的调集查询
方式/
1只查询ID为2,4,6的信息
select username from user where id in (2,4,6);

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

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

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


5按春秋排序
select*from user order by age asc;(升序)
select*from user order by age desc;(j降序)


6limit的利用
【MySQL中带in关键字的集合查询】限制查询前5个信息

以上内容就是MySQL中带in关键字的集合查询的内容啦 , 希望对你有所帮助哦!
猜你喜欢
- mysql数据量大时怎么建立索引提高查询效率
- mysql数据库和数据表的基本操作
- mysql数据库建表和SQL修改表结构
- MySQL 5.7安装配置
- KTV中带动气氛的歌曲有哪些
- 如何计算mysql数据表某一列的平均值
- 如何安装配置mysql
- sql语句查询mysql数据库,怎么取前几天的数据
- MYSQL如何替换部分字符串
- 图解MySQL的安装方法
