我有一个类别表:
ID Category "1","Baking" "3","Family" "4","Entertaining" "5","Children" "6","Desserts"
现在我想订购select语句的结果
ID Category "4","Entertaining" "3","Family" "1","Baking" "5","Children" "6","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