Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的 android 应用程序中有一个包含名字和姓氏(用空格分隔)的列表。我需要按此列排序以在列表视图中显示它。我正在使用 rawquery 来执行此操作。
您可以使用这种类型的查询:
SELECT * FROM Person ORDER BY LOWER(yourFieldName);
你也可以这样做ORDER BY yourFieldName COLLATE NOCASE。
ORDER BY yourFieldName COLLATE NOCASE
编辑:如果您需要指定ASCor DESC,请在之后添加NOCASE
ASC
DESC
NOCASE