Мне потребовалось отключить согласно приведенной ниже структуре.и я восстановил свой вывод с помощью unpivot SQL Query.
сценарий для текущей таблицы:
GO
/****** Object: Table [dbo].[mayank_UnPivot] Script Date: 12/20/2018 10:08:19 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[mayank_UnPivot](
[paticular_L] [varchar](50) NULL,
[debit_L] [decimal](10, 2) NULL,
[credit_L] [decimal](10, 2) NULL,
[particular_A] [varchar](50) NULL,
[debit_A] [decimal](10, 2) NULL,
[credit_A] [decimal](10, 2) NULL,
[particular_FA] [varchar](50) NULL,
[debit_FA] [decimal](10, 2) NULL,
[credit_FA] [decimal](10, 2) NULL,
[particular_LAA] [varchar](50) NULL,
[debit_LAA] [decimal](10, 2) NULL,
[credit_LAA] [decimal](10, 2) NULL,
[particular_MEA] [varchar](50) NULL,
[debit_MEA] [decimal](10, 2) NULL,
[credit_MEA] [decimal](10, 2) NULL
) ON [PRIMARY]
GO
INSERT [dbo].[mayank_UnPivot] ([paticular_L], [debit_L], [credit_L], [particular_A], [debit_A], [credit_A], [particular_FA], [debit_FA], [credit_FA], [particular_LAA], [debit_LAA], [credit_LAA], [particular_MEA], [debit_MEA], [credit_MEA]) VALUES (N'Furniture', CAST(50000.00 AS Decimal(10, 2)), CAST(50000.00 AS Decimal(10, 2)), N'Sequrity Deposits', CAST(50000.00 AS Decimal(10, 2)), CAST(50000.00 AS Decimal(10, 2)), N'Machinery', CAST(1200000.00 AS Decimal(10, 2)), CAST(1200000.00 AS Decimal(10, 2)), N'Loan From Kotak Bank', CAST(3000000.00 AS Decimal(10, 2)), CAST(3000000.00 AS Decimal(10, 2)), N'Bank Service Charge', CAST(1000.00 AS Decimal(10, 2)), CAST(1000.00 AS Decimal(10, 2)))
GO
и вывод таблицы такой, как показано ниже:
paticular_L debit_L credit_L particular_A debit_A credit_A particular_FA debit_FA credit_FA particular_LAA debit_LAA credit_LAA particular_MEA debit_MEA credit_MEA
Furniture 50000.00 50000.00 Sequrity Deposits 50000.00 50000.00 Machinery 1200000.00 1200000.00 Loan From Kotak Bank 3000000.00 3000000.00 Bank Service Charge 1000.00 1000.00
я требовал выводакак показано ниже:
particular debit credit
Furniture 50000.00 50000.00
Sequrity Deposits 50000.00 50000.00
Machinery 1200000.00 1200000.00
Loan From Kotak Bank 3000000.00 3000000.00
Bank Service Charge 1000.00 1000.00