uid | joindate
A01 | 2015-01-01
A02 | 2016-02-01
A03 | 2016-03-01
我們希望當A02這個User登入時,報表顯示如下
A02 | 2016-02-01
A01 | 2016-01-01
A03 | 2016-03-01
SQL語法如何下呢?...
SELECT *
FROM mytable
ORDER BY
CASE
WHEN uid = 'A02' THEN 0
ELSE 1
END,
joindate
No comments:
Post a Comment