Ex. select * from table_name where aaa like '%1%' or aaa like '%3%' or aaa like '%5%' or aaa like '%7%'
String sql = " select * from table_name where ";
String condition = "";
for(int i=0;i<b.length;i++){
condition += ("".equals(condition))?"":" or " ;
condition += " aaa like '%"+b[i]+"%'" ;
}
sql += condition;
/*** connect db ***/
2. แบบ แยก กัน
Ex. select * from table_name where aaa like '%1%'
select * from table_name where aaa like '%3%'
select * from table_name where aaa like '%5%'
select * from table_name where aaa like '%7%'
for(int i=0;i<b.length;i++){
String this_sql = " select * from aaa where aaa like '%"+b[i]+"%'";
/*** connect db ***/
}