Hi All,
I have an requirment where I want to convert column in to below 2 format .
Query to populate the table with data
CREATE TABLE bil
(
Due_Date date,
ID BIGINT,
Payment int,
CODE NVARCHAR(10)
)
INSERT INTO bil
SELECT '01-10-2021', '56536' , 63 ,'CIS' UNION ALL
SELECT '01-10-2021', '56536' , 6 ,'PTD' UNION ALL
SELECT '01-10-2021', '56536' , 87 ,'ELM' UNION ALL
SELECT '01-11-2021', '56536' , 63 ,'CIS' UNION ALL
SELECT '01-11-2021', '56536' , 6 ,'PTD' UNION ALL
SELECT '01-11-2021', '56536' , 87 ,'ELM' UNION ALL
SELECT '01-10-2021', '56896' , 63 ,'CIS' UNION ALL
SELECT '01-10-2021', '56896' , 6 ,'PTD' UNION ALL
SELECT '01-10-2021', '56896' , 87 ,'ELM' UNION ALL
SELECT '01-11-2021', '56896' , 63 ,'CIS' UNION ALL
SELECT '01-11-2021', '56896' , 6 ,'PTD' UNION ALL
SELECT '01-11-2021', '56896' , 87 ,'ELM'
Please do let me know the logic which help to get the required result output set uisng sql
Thanks in advance,