I have a array list of integers . I want to use this list in the IN clause of SQL query. I tried to do the below, but i know it wont work. Can someone suggest a better way .
List<Integer> **plcList** = new ArrayList<Integer>();
String finalQuery = "
select plc,direction,ROUND(AVG(CAST(speed as float)),2) as speed,COUNT(plc) as count,time_id
from processed
WHERE plc IN " + " " + "(**plcList**)"+ " " + "
group by plc, direction, time_id";