我的数组包含了一些元素:使用表中的Where子句
(
"element 1",
"element 2",
"element 3"
)
我需要查询数据库,并获取存储阵列中的上述数据库中的每一个元素:
select * from table1 where type=?
我得到了for循环的想法,对于数组,选择查询将根据数组的大小重复执行,这并不是很有用。
任何想法,thanx提前:)
我的数组包含了一些元素:使用表中的Where子句
(
"element 1",
"element 2",
"element 3"
)
我需要查询数据库,并获取存储阵列中的上述数据库中的每一个元素:
select * from table1 where type=?
我得到了for循环的想法,对于数组,选择查询将根据数组的大小重复执行,这并不是很有用。
任何想法,thanx提前:)
使用IN
operator:
select * from table1 where type in ('element1', 'element2');
你的意思是这样
select * from table1 where type in ('type1', 'type2', 'type3')
?
它为什么被标记为'iOS'? – rishi