May 30, 2005 at 12:24 pm
it is legal if I write like this:
select * from t1 where c1 in (select c1 from t2)
what if i write
select * from t1 where (c1,c2) in (select c1,c2 from t2)
Howcan I do if there are more than one members in the set and I want to use in operation and subquery?
May 30, 2005 at 12:27 pm
select * from t1
where exists (select * from t2 where t1.c1 = t2.c1 and t1.c2 = t2.c2)
Tim S
May 30, 2005 at 1:39 pm
you could also use joins...
SELECT t1.* FROM t1 INNER JOIN t2 ON t1.c1 = t2.c1 AND t1.c2 = t2.c2
May 30, 2005 at 2:13 pm
Unfortunately SQL Server does not support row value constructors and assignment. That means it does not support row comparison operators and therefore cannot do row subqueries, as in your example.
For this example you can use the solutions suggested by the other posters.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply