"Reto Baudenbacher" <[EMAIL PROTECTED]> wrote: > hi > > Sorry for this newbie-question: > > is it possible to simplifiy the following (working) query? > > > > "SELECT * FROM mytable WHERE > > ((col1 LIKE '%test%') OR (col2 LIKE '%test%') OR (col3 LIKE 'test%')) > > AND > > (col5 = 'y' OR col6 = 'y' OR col7 = 'y') ORDER BY col1"
What do you mean 'simplifiy'? You can rewrite the above query using UNION instead of OR, but the new query will not be very simple, too. -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net <___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]