日期:2014-05-17 浏览次数:20620 次
WITH chufang
AS ( SELECT 23 picid
UNION
SELECT 34
UNION
SELECT 43
UNION
SELECT 32
UNION
SELECT 12
UNION
SELECT 45
)
SELECT *
FROM chufang
WHERE picid IN ( 23, 34, 43, 32, 12, 45 )
ORDER BY CASE picid
WHEN 23 THEN 1
WHEN 34 THEN 2
WHEN 43 THEN 3
WHEN 32 THEN 4
WHEN 12 THEN 5
WHEN 45 THEN 6
END
/*
picid
-----------
23
34
43
32
12
45
(6 行受影响)
*/