我有一个包含 100 列或更多列的表,其值可能为“是”或“否”。
我想根据用户的请求(复选框值表单)进行选择,以提取所有值为“yes”的行。所以一个例子可能是:
- 用户选择 checkbox1 checkbox4 和 checkbox7 并且所有其他都没有被选中。
查询可能是:
select name from table where (col1 = yes or col4 = yes or col7 = yes) AND (col2= no and col3 = no and all other columns are set to no)
如何在 android 查询中实现这一点?顺便说一下,我发现这个实现不是很优雅,有人可以建议我实现这个目标的其他实现吗?