Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Posts
    311

    Unanswered: inner outer left right join?

    i have an inner join qry :
    SELECT Fedex.CheckNum,
    Fedex.NetCharge ,
    Fedex.InvoiceNum ,
    Fedex.InvoiceDate ,
    Fedex.AirBillNum ,
    Fedex.Deal ,
    Fedex.Code ,
    Fedex.Person
    FROM Fedex inner JOIN Master ON Fedex.CheckNum =Master.CheckNum;

    it returns 277 rows of 327 in the table.

    What kind of join can i use to return only the 50 rows that dont get returned from this qry?

    Why are they not being returned the cknum should be in the master table


    thanks


    Mike

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Re: inner outer left right join?

    Originally posted by mikezcg
    i have an inner join qry :
    SELECT Fedex.CheckNum,
    Fedex.NetCharge ,
    Fedex.InvoiceNum ,
    Fedex.InvoiceDate ,
    Fedex.AirBillNum ,
    Fedex.Deal ,
    Fedex.Code ,
    Fedex.Person
    FROM Fedex inner JOIN Master ON Fedex.CheckNum =Master.CheckNum;

    it returns 277 rows of 327 in the table.

    What kind of join can i use to return only the 50 rows that dont get returned from this qry?

    Why are they not being returned the cknum should be in the master table


    thanks


    Mike
    Try:

    SELECT Fedex.CheckNum,
    Fedex.NetCharge ,
    Fedex.InvoiceNum ,
    Fedex.InvoiceDate ,
    Fedex.AirBillNum ,
    Fedex.Deal ,
    Fedex.Code ,
    Fedex.Person
    FROM Master LEFT OUTER JOIN Fedex ON Fedex.CheckNum =Master.CheckNum;

  3. #3
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778
    Select ta.*
    from tableA ta
    LEFT OUTER JOIN
    tableB tb ON
    ta.id = tb.id
    Where tb.id IS NULL;

    This query will return a set of tuples from tableA that do not match any tuples of tableB, on the join condition (ta.id = tb.id).
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

Posting Permissions

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