winfwu

导航

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';

  

 

posted on 2013-04-01 21:54  winfwu  阅读(566)  评论(0编辑  收藏  举报