I am trying to export an SQL query to Excel, and I need this behaviour but I can't find in anywhere.
This is what I currently have:
SELECT t1.c1, t2.c2
FROM table1 t1
INNER JOIN table2 t2 ON t1.id = t2.id;
|c1| c2 |
----------------
|a | sometext1 |
|a | sometext2 |
|a | sometext3 |
|a | sometext4 |
|b | sometext5 |
|b | sometext6 |
|b | sometext7 |
I want to show the results like this:
|c1| c2 |
|a | sometext1 |
| | sometext2 |
| | sometext3 |
| | sometext4 |
|b | sometext5 |
| | sometext6 |
| | sometext7 |
I want to show only the first item in each group, and hide the rest so it's not shown in Excel. I am using SQL Server.