October 27, 2005 at 8:01 am
Hi,
I have SQL SERVER 2000.
I want to have subquery like:
select * from table1 where (id,date_x) not in (select id, date_x from table2)
But Sql server except only single column subquery.
Is there any other way to handle this subquery.
October 27, 2005 at 8:14 am
Select Cols from dbo.Table1 T1 RIGHT join dbo.Table2 T2 on T1.id = T2.id and T1.date_x = T2.date_x
where
T1.id is null
October 27, 2005 at 8:18 am
And another one (probably not better though):
SELECT * FROM table1 WHERE NOT EXISTS (SELECT * FROM table2 WHERE id = table1.id AND date_x = table1.date_x)
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply