匹配不含有某个信息的sql语句写法

SELECT id,order_id,flight_info FROM order_flights WHERE mark=0 AND flight_info REGEXP '[^() DAY)]' ORDER BY id DESC LIMIT 1;

 

????????????

逻辑比较复杂的sql语句如下:

SELECT
id,
order_id,
flight_info
FROM
order_flights
WHERE mark = 0
AND flight_info NOT REGEXP 'DAY [2-8]'
AND flight_info REGEXP 'DAY 1'
AND order_id >0
ORDER BY id DESC
LIMIT 5;

继续寻找比较简单的sql语句: 

 

posted @ 2014-04-26 17:33  唾手可得的树  阅读(477)  评论(0编辑  收藏  举报