Hello Sir
i have only one table having only three record now name Table_log
i created self join basically two record will come on join
first row id column having parent id is 0 next gstsupply have parentid is 1 and newrpt table name having no parent
so basically maintaing parent child relation.
Id UserId TableName RowNumber Sheet SupplyType FileType ParentId CreatedDate CreatedBy ModifiedDate ModifiedBy
1 1 VenderReport 1 Sheet01 SupplyType01 File01 0 2019-12-10 1 2019-12-10 1
3 1 gstsupplyu 3 Sheet01 SupplyType01 File01 1 2019-12-10 1 2019-12-10 1
4 1 newrpt 2 sh1 spl1 f01 0 2019-12-10 1 2019-12-10 1
select t.Id,t.UserId,t.RowNumber,t.Sheet,
t.SupplyType,t.FileType,t.CreatedDate,t.CreatedBy,
t.ModifiedDate,t.ModifiedBy,
t.tablename,s.TableName as Mastername
from Table_Log t inner join Table_Log s on t.Id=s.ParentId
there will be basically two record will come because third row having no parentid
please give me solution.