Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有这样的数据:
我想对数据进行排序,结果是这样的: CHECKING_ACCT_MONTHS--------------------11-201110-201109-2011AVERAGE 换句话说,数据会降序排列,但AVERAGE数据会在底部。我怎样才能做到这一点,。?
CHECKING_ACCT_MONTHS
--------------------
11-2011
10-2011
09-2011
AVERAGE
查询应该是...
SELECT * FROM TableName ORDER BY CASE WHEN CHECKING_ACCT_MONTHS = 'AVERAGE' THEN 1 ELSE 0 END, CHECKING_ACCT_MONTHS DESC