dbTalk Databases Forums  

help on join....

comp.database.oracle comp.database.oracle


Discuss help on join.... in the comp.database.oracle forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Root
 
Posts: n/a

Default help on join.... - 07-27-2004 , 12:09 PM






How can I do this in a single select statement?


Table A

Name ID
Eric 1
Jeff 2
Ted 3
Tad 4


Table B

Id sales
1 10,000
1 12,000
3 10,000


Result

Name Id Sales
Eric 1 10,000
Eric 1 12,000
Ted 3 10,000
Jeff 2
Tad 4



Anyone know how to perform a query like this in a single select statement?



Reply With Quote
  #2  
Old   
Michael J. Moore
 
Posts: n/a

Default Re: help on join.... - 07-29-2004 , 09:44 PM






select tablea.name,tablea.id,tableb.sales
from tablea,tableb
where tablea.id = tableb.id(+);

"Root" <root (AT) aol (DOT) com> wrote

Quote:
How can I do this in a single select statement?


Table A

Name ID
Eric 1
Jeff 2
Ted 3
Tad 4


Table B

Id sales
1 10,000
1 12,000
3 10,000


Result

Name Id Sales
Eric 1 10,000
Eric 1 12,000
Ted 3 10,000
Jeff 2
Tad 4



Anyone know how to perform a query like this in a single select statement?





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.