Table structure:
ProjectID ParentID Name Path
38 2 client |2|38|
108 38 Sample1 |2|38|108
205 38 Sample2 |2|38|205
206 38 Sample3 |2|38|206
207 38 Sample4 |2|38|207
Query:
SELECT Name, ProjectId
FROM dbo.Projects project
WHERE ParentID = 38
This would give me all the rows from the above table except the first row.
However I want to achieve the following!
ProjectID ParentID Name Path
108 38 clientSample1 |2|38|108
205 38 clientSample2 |2|38|205
206 38 clientSample3 |2|38|206
207 38 clientSample4 |2|38|207
SQL experts please let me know the query on how to achieve this. I appreciate your input.
PN: Sorry about the table structure. I couldn't paste any images yet.