How to get the parent child relation in same table In Sql Server

SELECT

ChildUserType.Id as CategoryId,ChildUserType.Category as CategoryName,

ChildUserType.IsActive,ChildUserType.CategoryURL as CategoryURL,

ChildUserType.CreatedOn,ChildUserType.ParentId,

ParentUserType.Category as ChildParentname,ChildUserType.NoofOrgs

FROM 

[dbo].[Categories] AS ChildUserType

LEFT JOIN 

[dbo].[Categories] AS ParentUserType 

ON 

ChildUserType.ParentId = ParentUserType.Id 

Comments

Popular posts from this blog

How to use youtube api's in your application.

Implement virtualisation in kendo drop down list using jquery ajax in mvc, aspx page

Interview Questions-2