我想做查询表中字段ID一些的山谷像1,5,4,11这将根据选择来自于previous屏幕。
i wanted to do query in table for field id with some vales like 1,5,4,11 which will come from previous screen according to selection.
cursor = database.query(tablename,
new String[] { "TopName" }, "id =?", new String[]{"2,3"}, null, null, null);
当我不喜欢这样我得到光标数0,用新的String [] {2}我得到的价值,我想与价值观所有ID字符串数组喜欢或具有在该列中的值。
when i do like this i am getting cursor count 0,with new String[]{"2"} i am getting value i want for all ids with values in string array like OR which have value in that column.
您可以使用运营商这样的,
You can use the IN operator like this,
cursor = database.query(tablename, new String[] {"TopName"}, "id IN(?,?)",
new String[]{"2","3"}, null, null, null);
上一篇:Android的TimePicker(轮式)没有正确响应轻弹内滚动型手势手势、轻弹、正确、Android
下一篇:安装错误:INSTALL_FAILED_MISSING_SHARED_LIBRARY错误、INSTALL_FAILED_MISSING_SHARED_LIBRARY