Closed silverAndroid closed 6 years ago
yes IN is supported, I posted an example here https://github.com/tekartik/sqflite/blob/master/example/lib/exp_test_page.dart#L67-L77
Two solutions for you
where: 'id IN (?, ?, ?...?)'
and put the ids in an array in whereArgs: ids
where: 'id IN (${ids.join(', ')})'
Thanks!
If you query for strings: where: 'id IN (${strings.map((e) => "'$e'").join(', ')})'
tuve problemas en solucionar pero me llevo un tiempo sqflite: ^1.3.0+3
where: 'idDb IN (${user.map((e) => "?").join(', ')})',
List<int> user = [ 2,3,5,9 ];
List<Map> maps = await dbClient.query(
'programacionInspeccion',
columns: ['*'],
where: 'idDb IN (${user.map((e) => "?").join(', ')})',
orderBy: 'fechaInicial ASC ',
whereArgs: user,
);
Does sqflite support using WHERE...IN? Because when I try
it returns 0 rows, which means it's most likely not forming the query properly (although I'm not sure how I can see the complete query being sent), and I'm sure it's not the DB missing the data or writing the query wrong because when I did a query on the DB myself, it returned the rows I was looking for.