Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 where (1,2,3) in (2,3)=2,3

Author  Topic 

genvej
Starting Member

2 Posts

Posted - 2007-06-06 : 04:06:44
I cant seem to find the syntax for the following
where (1,2,3) in (2,3)=2,3

i have done it in oracle and im eagerly looking for the equilivant

thx in advance

mwjdavidson
Aged Yak Warrior

735 Posts

Posted - 2007-06-06 : 04:16:16
Can you explain what you're trying to achieve and what the expected result is for those of us not familiar with PL/SQL.

Mark
Go to Top of Page

genvej
Starting Member

2 Posts

Posted - 2007-06-06 : 04:21:38

i have a table with a combined key....


where {(1,2),(3,4),(5,6)} in {(3,4),(5,6),(7,8)}
=
3,4 row
5,6 row
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2007-06-06 : 05:09:57
Oracle gives you an abbreviated syntax to define a derived table which isn't available in sql server.

select a.i, a.j
from
(
select i=1,j=2
union all
select i=3,j=4
union all
select i=5,j=6
) a
join
(
select i=3,j=4
union all
select i=5,j=6
union all
select i=7,j=8
) b
on a.i = b.i
and a.j = b.j


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

mwjdavidson
Aged Yak Warrior

735 Posts

Posted - 2007-06-06 : 05:16:43
Ah.. I see!

Mark
Go to Top of Page
   

- Advertisement -