Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2003
    Posts
    4

    Unhappy Unanswered: need help with outer join query :(

    ok. i am converting all my old non-ansi sql to sql code and ran across one that i didnt know how to convert in ansi....


    select * from table a, table b where a.column(+)=b.column

    converts to

    select * from table b left outer join a ON (a.column=b.column)

    cool..... but what do i do when i have a table that is the strong table on 1 outer join and then the weak table on another? i cant just declare it twice cuz i get table already defined...

    how would i convert......
    (needed to edit it... there is no column in A that matches a column in table C)
    ---

    select * from table a, table b, table c
    where a.column(+)=b.column AND
    b.column2(+)=c.column2

    ?
    Last edited by wolfspawn; 02-12-03 at 15:26.

  2. #2
    Join Date
    Sep 2001
    Location
    Vienna
    Posts
    400

    outer joins

    I've no quick answer for that

    try the usenet
    pgsql-sql list

    there are such specific questions and there are the experts for such things
    http://www.postgresql.org
    --Postgresql is the only kind of thing--

  3. #3
    Join Date
    Jan 2003
    Location
    Duncan BC Canada
    Posts
    80

    Re: outer joins

    Originally posted by eperich
    I've no quick answer for that

    try the usenet
    pgsql-sql list

    there are such specific questions and there are the experts for such things
    Are you saying that this forum is not the appropriate place to discuss it?
    Bradley

  4. #4
    Join Date
    May 2002
    Location
    Florida, USA
    Posts
    49

    Re: need help with outer join query :(

    [SIZE=1]Originally posted by wolfspawn
    cool..... but what do i do when i have a table that is the strong table on 1 outer join and then the weak table on another? i cant just declare it twice cuz i get table already defined...
    What exactly do you mean by "strong" and "weak"?


    how would i convert......
    (needed to edit it... there is no column in A that matches a column in table C)
    ---

    select * from table a, table b, table c
    where a.column(+)=b.column AND
    b.column2(+)=c.column2

    ?
    Here's an exercise I try whenever a query gets me bogged down: I try to describe what I want in a short list of single-subject sentences, in plain English (or whatever is your native language). You would be surprised at how suddenly things can become clear when you do that. Try it now... just tell us in short sentences exactly what it is you want to accomplish, and then we will see if we can come up with an answer .

  5. #5
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    those plus signs are weird, aren't they?

    if your example is correct, then try this --
    Code:
    select * 
      from table c
    left outer
      join table b
        on c.column2 = b.column2
    left outer
      join table a 
        on b.column = a.column
    rudy
    http://r937.com/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •