I am trying to generate SQL output similar to how Excel does the merge cells.
Sample output from SQL select statement