This should be easy for someone who has been writing SQL statements for awhile.
I need to query for information in a table that looks similar to this:
SELECT field1 FROM table WHERE field2='123' OR field3 LIKE '456*' OR field3 LIKE '678*'
You can see the delimma with the statement. Field2 must be equals to '123' while field 3 can take either of the two LIKES. The way the statement reads, any records with field2 equaling '123' or field3 with the LIKES will be selected.
I need the statement to select either field2='123' and field3 LIKE '456*' .... or .... field2='123' and field3 LIKE '678*'
Thanks for your help.
I need to query for information in a table that looks similar to this:
SELECT field1 FROM table WHERE field2='123' OR field3 LIKE '456*' OR field3 LIKE '678*'
You can see the delimma with the statement. Field2 must be equals to '123' while field 3 can take either of the two LIKES. The way the statement reads, any records with field2 equaling '123' or field3 with the LIKES will be selected.
I need the statement to select either field2='123' and field3 LIKE '456*' .... or .... field2='123' and field3 LIKE '678*'
Thanks for your help.