I'm confused about AND/OR NOT LIKE in mysql query ..
my query is like this
select * from news_view WHERE collection_id = 18259 and ((news_headline NOT like '%Kim%' OR news_summary NOT like '%Kim%')) order by pub_date desc
it returns the records that contains the word 'Kim' in news_summary though It shouldn't .. but when I use AND it returns results ok i.e it doesn't return the records that contains word 'Kim'
I want to make it like this, if 'Kim' presents in both fields or in one of the fields it shouldn't appear ..
confused when I used AND ... it shouldn't show when word is present in news_summary and not in news_headline ..
Following works great btw,
select * from news_view WHERE collection_id = 17743 AND NOT (news_headline like '%Kim%' OR news_summary like '%Kim%') order by pub_date desc
NOT (x OR y) is the same as NOT x AND NOT y
oo Yes, you are right!