Correction in logic to pass a 'list' in a SQL IN() clause