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

带in关头字的调集查询

方式/步调

  1. 1

    只查询ID为2,4,6的信息

    select username from user where id in (2,4,6);

  2. 2

    除了不查询ID为2,4,6的信息外,其他的信息

    select username from user where not id in (2,4,6);

  3. 3

    查询sex中开首为w的信息

    select username,age from user where sex like 'w%';

  4. 4

    查询address中中心有u的信息,'_'的利用

    select username,age from user where address like '_u%';

    查询address中含有a的信息

    select username,age from user where address like '%a%';

  5. 5

    按春秋排序

    select*from user order by age asc;(升序)

    select*from user order by age desc;(j降序)

  6. 6

    limit的利用

    限制查询前5个信息

  • 发表于 2018-04-10 00:00
  • 阅读 ( 970 )
  • 分类:其他类型

你可能感兴趣的文章

相关问题

0 条评论

请先 登录 后评论
联系我们:uytrv@hotmail.com 问答工具