what is the required t-sql for getting all the child categories in a parent category?
my table is like this : id | name | parentid
serkan sendur 821 Postaholic Banned Featured Poster
Recommended Answers
Jump to PostSELECT dbo.Category.Name, dbo.Category.ID FROM dbo.Category LEFT OUTER JOIN dbo.Category AS Category_1 ON dbo.Category.ID = Category_1.ParentID WHERE (Category_1.ParentID IS NULL)
Jump to PostSorry for being late as I was in Army last two days..
SELECT Category_1.Name FROM Category LEFT OUTER JOIN Category AS Category_1 ON Category.ID = Category_1.ParentID WHERE (Category_1.ParentID = 1)
All 6 Replies
Ramy Mahrous 401 Postaholic Featured Poster
Jx_Man 987 Nearly a Senior Poster Featured Poster
serkan sendur 821 Postaholic Banned Featured Poster
Ramy Mahrous 401 Postaholic Featured Poster
serkan sendur 821 Postaholic Banned Featured Poster
serkan sendur 821 Postaholic Banned Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.