Left Outer Join

  • How do you limit a left outer join to the first match ?

  • If I understand your wishes, it seems like you want to use a subquery...

    SELECT col1, col2, ( SELECT min(col3) from othertable where condition ) as col3

    FROM maintable

    WHERE condition

    Is that what you are asking?

    Guarddata-

  • I only want the same number of records from my primary file matching the first occurance of the secondary or outer join file

  • Can u be more specific. With a left outer join the first result be be null if there is no data match! Can u post samples?

    I did post this on your other post though

    select distinct m.cola,m.colb from maintable m

    inner join othertable x on x.key = m.key

    or

    select m.cola,m.colb from maintable m

    inner join (select distinct key from othertable) x on x.key = m.key

    Far away is close at hand in the images of elsewhere.
    Anon.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply