摘要:
--就在OVER order by 中用case语句进行判断。 IF ( OBJECT_ID('tempdb..#TempTable') IS NOT NULL ) DROP TABLE #TempTable SELECT * INTO #TempTable FROM ( SELECT ROW_NUMBER() OVER ( ORDER BY CASE WHEN @orderby ='CreateDate DESC' THEN CreateDate END DESC, CASE WHEN @orderby ='Crea... 阅读全文