PDA

View Full Version : Negative words in like statement


sackstein
12-06-2009, 07:53 PM
Hello,

I know very little about sql queries. However I managed to setup part of my query that searches for the words Gold and Earrings. like so:

pd.products_name LIKE('%gold%') and pd.products_name LIKE('%earrings%')

I am trying to figure out how to set it up so that I can make it search for Earrings as well as anything that doesnt have the word "Silver" in it but I don't know the statement I need for this..

is it UNLIKE('%silver%')

that does not seem to work or -silver I really don't know..

BubikolRamios
12-06-2009, 10:36 PM
try:

NOT LIKE

guelphdad
12-07-2009, 04:12 PM
See full text boolean searching here: http://dev.mysql.com/doc/refman/5.0/en/fulltext-boolean.html