Re: Results with identical fields
Posted by: Rick James
Date: January 12, 2011 08:34PM

SHOW CREATE TABLE -- perhaps we can recommend a better schema.

Meanwhile...
WHERE
field4 = 'London' OR
field5 = 'London' OR
field6 = 'London' OR
field7 = 'London'

Yeah, messy.

Shorter, but not necessarily better:

WHERE
FIELD('London', field4, field5, field6, field7) > 0

See
http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_field

Options: ReplyQuote


Subject
Written By
Posted
Re: Results with identical fields
January 12, 2011 08:34PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.