inner join

Last post 02-19-2010 8:56 AM by Sonu. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 02-19-2010 8:41 AM

    • pearlmca
    • Not Ranked
    • Joined on 02-19-2010
    • Wannabe Slacker
    • Points 48

    inner join

    I am new to sqlserver my table having field such as

    piececode parentpiececode
    4001 4001
    4002 4001
    4003 4002

    Its like a tree diagram

    4001 is parent so its parent piececode is 4001

    4002 is a child for 4001 so its parent piececode is 4001,

    4003 is a child for 4002 ,so its parent piececode is 4002,

    like that it goes ...no end..

    my requirement is i want parent piececode for 4003 output is 4001

    output..

    ex

    4003 parent piececeode is 4002,

    4002 parent piececode is 4001,

    4001 parent piececode is 4001

    <ie>top parent piececode answer: 4001

     

     

     

     

     

  •  Advertisement

    Featured Advertisement

     
  • 02-19-2010 8:56 AM In reply to

    • Sonu
    • Top 10 Contributor
    • Joined on 05-22-2006
    • Montreal / Canada
    • Slacker
    • Points 12,183
    • MVP

    Re: inner join

    Your question is not clear. Please rephrase and post again. Also I recommend taking a look at this article: http://dotnetslackers.com/articles/sql/SQL-SERVER-JOINs.aspx

    [MVP since 2005] [MCAD]
    Webmaster of DotNetSlackers
    Question or Suggestion?
    Feel free to ask my any .NET question
    Our Posting FAQ
    Filed under: , ,
Page 1 of 1 (2 items)