table record is like this and i find out result according to autoId 5
the result show according to auto id 5
show record like this
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Iftikar HussainPosted Jun 14, 2013, 6:42 AM
You can use hierarchyid datatype.
You can refer this
http://technet.microsoft.com/en-us/library/bb677173.aspx
Regards,
Iftikar
Jignesh TrivediPosted Jun 10, 2013, 10:54 PM
I am not understand your question clearly but try following query
select max(AutoId) as AutoId,ParentId from #temp
group by ParentId
hope this will help you.
Bhupendra SinghPosted Jun 10, 2013, 6:33 AM
suppose my id is 3 then result should be select id only: 1
if we select id is 4 then result should be select id only: 3,1
Amit ChoudharyPosted Jun 10, 2013, 6:06 AM