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

 时间:2026-02-15 09:19:39

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关键字的集合查询

  • MySQL安装applying security settings错误解决
  • C++创建一个CPU类
  • 怎么用echarts.js画一个饼状图?
  • 控件内的对齐方式由什么属性决定
  • heralded什么意思
  • 热门搜索
    驾照丢了怎么补办 邬怎么读 林氏木业家具怎么样 红酒怎么开 爱要怎么说出口 鼻毛太长怎么办 百褶裙的裁剪与做法 阅读记录卡怎么写 倍耐力轮胎怎么样 养老保险怎么交