By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,007 Members | 1,248 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,007 IT Pros & Developers. It's quick & easy.

Sybase to UDB migration --- help required on joins

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
a.id1 *= b.id1 means a left outer join b on a.id1 = b.id1.

Thanks,
Sandip.

Nov 12 '05 #3

P: n/a
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.