Results 1 to 5 of 5
  1. #1
    Join Date
    May 2011
    Posts
    3

    Red face Unanswered: join from one table to another two tables

    Hi to all, i am newbie to sql.
    i just want to link one table to two another.
    say i have 2 fields in Table A
    1-InwardID
    3-TfrID

    3 fields in Table B
    1-InwardID
    2-InwardCode
    3-InwardDate

    2 fields in Table C
    1-TfrId
    2-TfrDate

    now i want to show data from Table A
    when INwardId is present at fileld TfrId will be NULL and vice versa

    now i want to print InwardCode from Table B when InwardId is present in Table A and TfrDate from Table C when TfrId is present in Table A.

    PLease help me !!!

  2. #2
    Join Date
    May 2011
    Posts
    3
    pls guys, its urgent...

  3. #3
    Join Date
    Nov 2004
    Posts
    1,427
    Provided Answers: 4
    Try
    Code:
    SELECT A.InwardID, B.InwardCode, A.TfrID, C.TfrDate
    FROM #TableA as A
    	LEFT OUTER JOIN #TableB as B ON
    		A.InwardID = B.InwardID
    	LEFT OUTER JOIN #TableC as C ON
    		A.TfrID = C.TfrId
    Today 09:39
    jairaj.net
    join from one table to another two tables
    Today 09:48
    jairaj.net pls guys, its urgent...
    When you noticed that no one on this forum had answered your question within 9 minutes, you kindly reminded us how urgent this is to you. Nice .
    With kind regards . . . . . SQL Server 2000/2005/2012
    Wim

    Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
    Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages

  4. #4
    Join Date
    May 2011
    Posts
    3

    Thumbs up Thanks a Lot

    Thanks a LOT WIM
    it work.........
    Last edited by jairaj.net; 05-19-11 at 06:20.

  5. #5
    Join Date
    Dec 2010
    Location
    Manchester
    Posts
    24
    Sorry just noticed the reply

Posting Permissions

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