Something like this mayhaps:
DECLARE @cols AS NVARCHAR(MAX), @cols2 NVARCHAR(MAX), @sql AS NVARCHAR(MAX);
SELECT *
INTO #data
FROM (
VALUES (1, N'A', N'H', N'J')
, (2, N'B', N'I', N...
You need a conditional aggregation query for this -
WITH data AS (SELECT '001' EMPLOYEE, 'Basic' ELEMENT, 100 VALUE, 'Sales' DEPT FROM dual UNION ALL
SELECT '001', 'Rent', 300, 'Sales' F...
Lost your password? Please enter your email address. You will receive a link to create a new password.
Donate
Thank you for visit here to donate to us, you think it's just a cup of coffee, but with us, it's really meaningful and contributes to help this blog grow more and more.
You can support us in one of the ways below: