Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2003
    Location
    Canada
    Posts
    27

    Exclamation Unanswered: Looking for a Sample Stored Proc...

    Looking for a Sample Stored Proc...that does the following:

    Based off four tables within the following linking:

    Table 1 -> Table 2 = 1 link Left Outer Join
    Table 2 -> Table 3 = 4 links Left Outer Join
    Table 2 -> Table 4 = 5 links Left Outer Join

    Essentially I'm having problems where data won't come back because I have NULL values. I need to be able to do a FULL OUTERJOIN via a Stored Procedure.

    Can anyone suggest a small sample that would illustrate this?

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    It does not matter whether it is a stored procedure or not. The SQL to do the outer joins should be the same inside or outside the stored procedure.

    Select ... from table1 as t1 left outer join table2 as t2 on (t1.colA = t2.colb) left outer join table3 as t3 on (t2.colc = t3.cold and ...) left outer join table4 as t4 on (t2.cole = t4.colf and ...) where ...

    HTH

    Andy

Posting Permissions

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