eso ya es presentacion de datos, porque no lo haces desde tu aplicativo?
desde sql server no se me ocurre otra cosa mas que esto:
Código SQL:
Ver originalDROP TABLE #temp
CREATE TABLE #temp
(
id INT,
fecha datetime
)
INSERT INTO #temp VALUES (1,dateadd(dd,0,GETDATE()))
INSERT INTO #temp VALUES (2,dateadd(dd,-1,GETDATE()))
INSERT INTO #temp VALUES (3,dateadd(dd,-2,GETDATE()))
INSERT INTO #temp VALUES (4,dateadd(dd,-3,GETDATE()))
SELECT *,IDENTITY(INT,1,1) rn INTO #temp3 FROM #temp WHERE fecha=
(SELECT MIN(fecha) FROM #temp)
SELECT *,IDENTITY(INT,1,1) rn INTO #temp2 FROM #temp ORDER BY fecha ASC
SELECT * FROM(
SELECT * FROM #temp2
UNION
SELECT * FROM #temp3) AS t1
ORDER BY rn