I have a query that selects some fields to display from a table
SELECT Field1, Field2, Field3, Field4 FROM table1
I want instead of returning :
alt text http://img186.imageshack.us/img186/3455/87921605.png
To return:
alt text http://img227.imageshack.us/img227/3921/85722509.png
How could I modify my SQL statement to return the second figure ?
Or at least how to change the gridview properties of .Net to do so (if this is possible) ?
You can do this with a common table expression (
WITH), a self-join, and theROW_NUMBERandNULLIFfunctions.