Hello all,
I'm wondering if this is the right way to do this...
I have two tables to query, one query will be dependent on another. For instance, I'm selecting a couple fields from table1 where their names (i.e. field1 contains 'this_name', 'first_name', 'second_name') will pop up if their partial names are not in the second table (called table2 with field2, which holds 'first', 'second'). I know how to exclude single results via this query:
This would return 'this_name' and 'second_name'. But how do I exclude based on the second table? This would be much more flexible since values in the second table to check for would change a lot. I was thinking something like this:
I know that statement isn't correct, can someone tell me how to correctly implement this? In this case, only 'this_name' would be returned.
Thanks,
Jisoo23
I'm wondering if this is the right way to do this...
I have two tables to query, one query will be dependent on another. For instance, I'm selecting a couple fields from table1 where their names (i.e. field1 contains 'this_name', 'first_name', 'second_name') will pop up if their partial names are not in the second table (called table2 with field2, which holds 'first', 'second'). I know how to exclude single results via this query:
Code:
select field1 from table1 where field1 not like 'first%';
This would return 'this_name' and 'second_name'. But how do I exclude based on the second table? This would be much more flexible since values in the second table to check for would change a lot. I was thinking something like this:
Code:
select field1 from table1 where field1 not like in '(select field2 from table2)%';
I know that statement isn't correct, can someone tell me how to correctly implement this? In this case, only 'this_name' would be returned.
Thanks,
Jisoo23