July 18, 2012 at 11:27 pm
CREATE TABLE [dbo].[Trans1](
[RPTTypeCode] [char](2) NULL,
[Firstname] [varchar](50) NULL,
[LastName] [varchar](50) NULL,
[BarrowerID] [int] NULL,
[LoanTransID] [int] NULL
) ON [PRIMARY]
insert into [Trans1] values('B1','Swathi','B',10,1),('C1','Anu','CH',11,1),('E1','Chintu','KK',13,1)
CREATE TABLE [dbo].[Trans2](
[LoanAppID] [int] NULL,
[LoanTransID] [int] NULL,
[LoanNumber] [varchar](10) NULL
) ON [PRIMARY]
insert into [Trans2] values(1,1,'ABC123')
I want query output as below in sinlge row.
LoanNumber, B1.FirstName, B1.LastName,C1.FirstName,C1.LastName,E1.FirstName,E2.LastName
I do not want to hardcode "RPTTypeCode" column values because sometimes i get more values in the RPTTypeCode column of Trans1 table.
Anybody can help me please???
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply