SELECT * FROM (SELECT ROW_NUMBER()
over
(
ORDER BY
CASE WHEN @SortExpression ='Country_id' THEN Country_id END,
CASE WHEN @SortExpression ='Country_name' THEN Country_name END,
CASE WHEN @SortExpression ='Country_region' THEN Country_region END,
CASE WHEN @SortExpression ='Country_area' THEN Country_area END,
CASE WHEN @SortExpression ='Country_Population' THEN Country_Population END,
CASE WHEN @SortExpression ='Country_gdp' THEN Country_gdp END
)as num ,* From Country_Profile123) as tbl
WHERE num BETWEEN @column AND @column1
我解決了一半的問題(即分頁和排序),現在我想要做的是排序順序。將查詢設置爲asc或desc命令?
您的問題是什麼?加上這是om mysql,sql-server? – RageZ 2009-11-10 01:18:59
我使用SQL SERVER管理代碼。 我想做分頁和分頁。這是完成..但仍然是排序命令,我想要做.. 所以我想幫助.... – sikender 2009-11-10 01:24:10