Mysql unions and wheres

software development

#1

Is there a problem with using unions and where…I can’t get the following to work right, it retreives all records, not just WHERE something =‘2’

ie…

“SELECT something1, something2 FROM table1 UNION SELECT something3, something4 FROM table2 UNION SELECT something5, something6 FROM table3 WHERE somethingelse =‘2’”;

it just doesn’t work…anyone know why?


#2

never mind…looks like I needed to check my spelling of the field name…ugh, it works fine.