我找不到一个好的例子,但如果数据库中的名字是" namehascapsinit",它不会返回任何内容。无论如何都要忽略案例?
String selection = MyTable.COL_NAME + " = ?";
String[] selectionArgs = new String[]{ "NameHasCapsInIt" };
c = getActivity().getContentResolver().query(MyTable.CONTENT_URI, null, selection, selectionArgs, null);
提前感谢!
答案 0 :(得分:5)
使用此:
SELECT * FROM TableName WHERE col_name COLLATE NOCASE ="namehascapsinit"
答案 1 :(得分:1)
您可以像这样编写代码
("select * from TableName where col_name collate latin1_swedish_ci =?",String[] selectionArgs = new String[]{ "namehascapsinit" });
这是示例
select * from TableName where col_name collate latin1_swedish_ci ="namehascapsinit"
而不是latin1_swedish_ci你可以使用你想要的任何整理