【发布时间】:2018-01-14 02:30:50
【问题描述】:
我想在 SQLite 中使用联系人 ID 列表进行查询,并根据这些 ID 在列表中的顺序位置进行排序。
例如:
select * from Contact where Contact.ID in (1,3,2,4)
// then order by (1,3,2,4)
SQLite 中是否有任何等效结构,例如 mysql 中的“ORDER BY FIELD”? 例如
select * from Contact where Contact.ID in (1,3,2,4)
order by field (Contact.ID,1,3,2,4)
如果给出一长串 ID,也将支持,而不是像上面的示例那么短。
谢谢!
【问题讨论】:
标签: sqlite