MYSQL基础IN / BETWEEN AND / LIKE关键字用法

『1』带IN关键字查询

   用select * from employee;查询到表结构如下

  

  使用select * from employee where d_id in(1001,1004);SQL语句查询结果如下

  

  使用select * from employee where d_id not in(1001.1004);SQL语句查询结果如下

  

『2』BETWEEN AND关键字查询

  使用employee表做为数据库表。

  用select * from employee where d_id between 1003 and 1004;

  

  用select * from employee where d_id not between 1003 and 1004;

  

『3』带LIKE的字符匹配查询

  使用employee表做为数据库表。

  用select * from employee where name like '%i_e';

  

  用select * from employee where name not like '%i_e';

  

原文地址:https://www.cnblogs.com/DeepBlues/p/2994375.html