var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: identifying common elements of two columns of two tables
I am trying to get the list of ids that appears in two tables:
select id1 from table1 where id1 IN (SELECT id2 from table2).
However this query does not give the desired results.
Can id2 be NULL? If yes, use the following
where id1 IN (SELECT id2
WHERE id2 <> NULL)
Is there any faster way to solve this? I mean to check if the elements of some columns are also in a column of some other table?
What exactly do you mean with "elements of some columns"?
Please show us the table definitions (as CREATE TABLE statements), some sample data (as INSERT INTO statements) and the output you expect to see.
And please use [code] tags to make your SQL readable.
For details on how to use the tag, please see: http://www.dbforums.com/misc.php?do=bbcode