Hi,
Please ref my tables,
create table #ICT_Txn_QueriesHandlerDump
(
[RowID] [int] IDENTITY(1,1) NOT NULL,
[MemberID] INT,
[QueryRaisedBy] [nvarchar](50) NULL,
[QueryCategory] [nvarchar](200) NULL,
[QueryDetails] [nvarchar](max) NULL,
[CreatedOn] Datetime null
)
Insert Into #ICT_Txn_QueriesHandlerDump ([MemberID],[QueryRaisedBy],[QueryCategory],[QueryDetails],[CreatedOn])
Values (1001, 'Exide', 'Bank Related','KYC Missing','2023/04/01')
Insert Into #ICT_Txn_QueriesHandlerDump ([MemberID],[QueryRaisedBy],[QueryCategory],[QueryDetails],[CreatedOn])
Values (1001, 'BELSTAR', 'Documents related','Document Not Updated','2023/04/02')
Insert Into #ICT_Txn_QueriesHandlerDump ([MemberID],[QueryRaisedBy],[QueryCategory],[QueryDetails],[CreatedOn])
Values (1002, 'KOTAK', 'Courier Dispatch','Not Received','2023/04/05')
Insert Into #ICT_Txn_QueriesHandlerDump ([MemberID],[QueryRaisedBy],[QueryCategory],[QueryDetails],[CreatedOn])
Values (1001, 'BELSTAR', 'KYC Documents','Document Not Updated','2023/04/04')
create table #ICT_Txn_BranchResponseAgainstHOQueries
(
[RowID] [int] IDENTITY(1,1) NOT NULL,
[ParentRowID] INT,
[BranchResponseRemarks] [nvarchar](50) NULL,
[CreatedOn] Datetime null
)
Insert Into #ICT_Txn_BranchResponseAgainstHOQueries ([ParentRowID],[BranchResponseRemarks],[CreatedOn])
Values (1, 'Information Provided','2023/04/02')
Insert Into #ICT_Txn_BranchResponseAgainstHOQueries ([ParentRowID],[BranchResponseRemarks],[CreatedOn])
Values (2, 'Documents Updated','2023/04/04')
Insert Into #ICT_Txn_BranchResponseAgainstHOQueries ([ParentRowID],[BranchResponseRemarks],[CreatedOn])
Values (4, 'Dispatch one','2023/04/04')
Insert Into #ICT_Txn_BranchResponseAgainstHOQueries ([ParentRowID],[BranchResponseRemarks],[CreatedOn])
Values (3, 'KOTAK Courier dispatched','2023-04-23')
Hereby Join these 2 columns
[#ICT_Txn_QueriesHandlerDump].[RowID] = [#ICT_Txn_BranchResponseAgainstHOQueries].[ParentRowID]
I wanna result like this.
