strong text
Example:
Event | issue raised | issue closed |
---|---|---|
A | 03-08-2022 | null |
A | null | 04-08-2022 |
Expected output :
Event | issue raised | issue closed |
---|---|---|
A | 03-08-2022 | 04-08-2022 |
CodePudding user response:
You can achieve this by using aggregation with group by clause:
select Event, max(issue_raised) as issue_raised, max(issue_closed) as issue_closedfrom table_name
group by Event
CodePudding user response:
select Event, CONVERT(VARCHAR(10),max([issue raised]), 103) as issueraised, CONVERT(VARCHAR(10),max([issue closed]), 103) as issueclosed from Event group by Event
Result as
Event issue raised issueclosed
A 03/08/2022 04/08/2022