我有一个很大的问题,理解为什么查询在查询中使用LIKE
时工作,而在使用NOT LIKE
时不工作。不喜欢mysql查询
,我将发布以下查询:
select DISTINCT (mails), name
from disposable
JOIN (
SELECT DISTINCT (mail) as mails,
CONCAT(toys.firstname, ' ' , toys.lastname) as name
FROM toys2
join toys ON toys.userid = toys2.id
where ((toyid = '27' or toyid = '29')
and status != 'Sold'
and toys.regdate >= '2017-01-01'
)
) as tab
WHERE tab.mails LIKE CONCAT('%@', disposable.email)
你是什么意思与“不工作”...?它没有返回任何东西,或者没有返回你期望的东西? – Twinfriends
正在返回结果,好像比较没有发生 – user7861842
上面那个查询中没有'NOT LIKE' –