--用ORDER BY + CASE WHEN
WITH TT AS
(
SELECT 'A' AS F1 UNION ALL
SELECT 'B' AS F1 UNION ALL
SELECT 'C' AS F1 UNION ALL
SELECT 'D' AS F1 UNION ALL
SELECT 'E' AS F1
)
SELECT * FROM TT
ORDER BY (CASE F1 WHEN 'B' THEN 1 WHEN 'D' THEN 2 WHEN 'C' THEN 5 WHEN 'D' THEN 4 ELSE 999 END)
有问题追问