Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Oracle Server > Re: SQL questio...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 7 Topic 16537 of 17418
Post > Topic >>

Re: SQL question on an outer join

by Pat <pat.casey@[EMAIL PROTECTED] > May 9, 2008 at 10:18 PM

On May 9, 8:40 pm, fergus_v...@[EMAIL PROTECTED]
 wrote:
> Hello,
>  Learning SQL - will appreciate any help.
>  Here is the case:
>
> Two tables with 0..n relation****p
> TableA                  TableB
> -----------             --------------
> ColA                    ColB
>                            ColA_FK
>                            Col_C
>
> Data
> TableA.ColA
> ====================
>  1
>  2
>
> Table B
> ColB   ColA_FK    Col_C
>  11      2              12345
>  12      2              99999
>
>  Resultset:
>
>  --------------------------------------
>  ColA   ColB      Col_C
>  --------------------------------------
>  1       -        -
>  2       12       99999
>
>  In case no data exists in TableB for ColA=11,  1 from TableA shows up
> in result without any data from TableB
>  However, in case of 2 from ColA,  we want to record from TableB with
> Col_C = 99999
>
> I can do the outer join - however, how do I limit it so it picks only
> the row with 9999?
>
> Thanks in advance.
> Fergus

select tablea.cola, tableb.colb, tableb.colc from tablea left join
tableb on tablea.cola = tableb.cola_fk where tableb.colc = 9999
 




 7 Posts in Topic:
SQL question on an outer join
fergus_vr01@[EMAIL PROTEC  2008-05-09 20:40:53 
Re: SQL question on an outer join
Pat <pat.casey@[EMAIL   2008-05-09 22:18:55 
Re: SQL question on an outer join
fergus <fergus_vr01@[E  2008-05-10 09:02:53 
Re: SQL question on an outer join
Charles Hooper <hooper  2008-05-10 09:21:37 
Re: SQL question on an outer join
fergus <fergus_vr01@[E  2008-05-10 21:07:00 
Re: SQL question on an outer join
Charles Hooper <hooper  2008-05-11 06:05:01 
Re: SQL question on an outer join
fergus <fergus_vr01@[E  2008-05-11 13:59:46 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 14:37:59 CST 2008.