摘要: --就在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... 阅读全文
posted @ 2013-12-30 14:26 玄魄冰 阅读(3373) 评论(0) 推荐(0) 编辑