Re: [SQL ]有關 not like
※ 引述《dennis277 (我愛直話直說)》之銘言:
: 各位晚安,有個關於not like的問題請教於各位前輩
: 欄位一
: 1. V
: 2.null
: 3. ''
: 小弟想將SQL中欄位一中不like "v"值全數列出
: 所以...
: 當我select like '%v%'的時候 1.項目會跑出來
: 但反過來select not like '%v%'時 2.卻搜尋不出來(但3.會!)
: 請問是哪裡出問題呢!?
: 還請多指教了 謝謝
This is because NULL NOT LIKE expr always returns NULL, regardless
of the value of expr. The same is true for aggregate queries involving
NULL and comparisons using NOT RLIKE or NOT REGEXP.
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 211.76.137.169
討論串 (同標題文章)