我有一个表与类别:
ID Category "1","Baking" "3","Family" "4","Entertaining" "5","Children" "6","Desserts"
现在我想订购select语句的结果
ID Category "4","Entertaining" "3","Family" "1","Baking" "5","Desserts"
例如。在MysqL中,你会这样做:
SELECT * FROM CATEGORIES ORDER BY FIELD (ID,4,3,1,5,6);
你会怎么做在sqlite虽然?我没有“order by”字段。
ORDER BY CASE ID WHEN 4 THEN 0 WHEN 3 THEN 1 WHEN 1 THEN 2 WHEN 5 THEN 3 WHEN 6 THEN 4 END