469,356 Members | 2,016 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,356 developers. It's quick & easy.

Sybase to UDB migration --- help required on joins

Hi all,

I am facing a problem while migrating a Sybase SQL query to DB2 UDB.
The query involves left outer joins.

The Sybase query syntax is as follows :

select * from A, B, C
where A.id1 *= C.id1 and B.id2 *= C.id2

Can anyone please give me the equivalent query in DB2?

Thanks,
Sandip.

Nov 12 '05 #1
3 1305
sandip wrote:
Hi all,

I am facing a problem while migrating a Sybase SQL query to DB2 UDB.
The query involves left outer joins.

The Sybase query syntax is as follows :

select * from A, B, C
where A.id1 *= C.id1 and B.id2 *= C.id2

Can anyone please give me the equivalent query in DB2?

I think:
select *
from c
left outer join b
on B.id2 = C.id2
left outer join a
on a.id1 = c.id1

This assumes that the * marks the outer.

cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #2
a.id1 *= b.id1 means a left outer join b on a.id1 = b.id1.

Thanks,
Sandip.

Nov 12 '05 #3
sandip wrote:
a.id1 *= b.id1 means a left outer join b on a.id1 = b.id1.

Thanks,
Sandip.

OK, then:
select *
from A
left outer join C
on A.id1 = C.id1
left outer join b
on B.id2 = C.id2

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by AnandG | last post: by
7 posts views Thread by Raquel | last post: by
2 posts views Thread by Raquel | last post: by
2 posts views Thread by aww91 | last post: by
1 post views Thread by db2sysc | last post: by
1 post views Thread by pankaj_wolfhunter | last post: by
2 posts views Thread by pankaj_wolfhunter | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.