Transposing rows into columns based on a condition sql
问题 I have a following table (a simplified example, in fact the table contains multiple IDs, with variable numbers of dates, and variable number of events for each date): IDs Date Event 102 1996-10-16 00:00:00 A 102 1996-10-23 00:00:00 A 102 1996-10-23 00:00:00 B 102 1997-01-14 00:00:00 A 103 1997-01-14 00:00:00 D 103 1997-01-15 00:00:00 A 103 1997-01-16 00:00:00 A 103 1997-01-16 00:00:00 B 103 1997-01-16 00:00:00 C I am trying to get a table where I will have distinct IDs/Date pairs, with the