Re: New to Oracle




"Steven Kondolf" <skondolf@xxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:cb3oq1pmpi0b10a844v4g5eeg425n899ir@xxxxxxxxxx
> On Wed, 21 Dec 2005 21:13:32 -0800, "Jim Kennedy"
> <kennedy-downwithspammersfamily@xxxxxxxxx> wrote:
>
>>
>><inlove22@xxxxxxxxxxx> wrote in message
>>news:1135216259.818266.149110@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>> Hello! Wondering if someone can help educate me on the design on query
>>> that i would like to run.
>>>
>>> Table A Table B
>>> ID PAR_ID
>>> X_ROW_1 X_ROW_3
>>> .. ..
>>> .. ..
>>>
>>> Table A and B are linked by the ID and PAR_ID columns. So i need a
>>> select statement that queries for all records that contain the non null
>>> values of x_row_3 along with all the non_null values of x_row_1.
>>> Sort of something like this. I know its some type of join but i can
>>> get it to work.
>>>
>>> x_row_1 x_row_3
>>> 2343 234523
>>> 234324
>>> 5645
>>> 979779
>>>
>>
>>select a.x_row_1,b.x_row_3 from table_a a, table_b b where a.id=b.par_id
>>and
>>a.x_row_1 is not null and b.x_row_3 is not null
>>
>>Jim
>>
> I think you have to change the 'and' to 'or' in the select. If you
> don't, you'll only get one row returned.

It looks to me like you need to go with an outer join, instead of an inner
join.
It seems you are looking for all of the non null values from both columns.

Regards
Mike Enarson


.



Relevant Pages

  • Re: New to Oracle
    ... Wondering if someone can help educate me on the design on query ... Prev by Date: ...
    (comp.databases.oracle.misc)
  • Re: New to Oracle
    ... Wondering if someone can help educate me on the design on query ... Prev by Date: ...
    (comp.databases.oracle.misc)
  • New to Oracle
    ... Wondering if someone can help educate me on the design on query ... Prev by Date: ...
    (comp.databases.oracle.misc)
  • Re: Is this join valid?
    ... > complex set of tables and queries, but I've boiled down the behavior ... you describe a problem with the Design View that really should not ... affect what happens when running a query from ASP. ... > the SQL view after creating the query in Design View. ...
    (microsoft.public.inetserver.asp.db)
  • Re: query to combine values if true
    ... What if you keep your data tables in a well-normalized form (to help Access ... you can give them a form and a way to query and they'd be ... i am open to suggestions of a better design. ...
    (microsoft.public.access.gettingstarted)