第一种 not like 方法 select * from table where `zongbu` not like '%北京%' and `zongbu` not like '%上海%' and `zongbu` not like '%深圳%' and `zongbu` not like '天津' and `zongbu` not like '香港' and `zongbu` not like '沈阳' 第二种 not like 方法 SELECT * FROM table WHERE zo…
MySQL中union和order by是可以一起使用的,但是在使用中需要注意一些小问题,下面通过例子来说明.首先看下面的t1表. 1.如果直接用如下sql语句是会报错:Incorrect usage of UNION and ORDER BY. SELECT * FROM t1 WHERE username LIKE 'l%' ORDER BY score ASCUNIONSELECT * FROM t1 WHERE username LIKE '%m%' ORDER BY score ASC…
第一步:查找mysql的字符: mysql> show variables like '%char%';+--------------------------+----------------------------------+| Variable_name | Value |+--------------------------+----------------------------------+| charact…