Hello postgres=# select * from foo; +---+---+ | i | a | +---+---+ | 1 | a | | 2 | b | | 3 | c | +---+---+ (3 rows)
Time: 0,654 ms postgres=# select * from foo where i = ANY (string_to_array('1,3',',')::int[]); +---+---+ | i | a | +---+---+ | 1 | a | | 3 | c | +---+---+ (2 rows) Time: 0,914 ms regards Pavel Stehule 2009/8/26 Nacef LABIDI <nace...@gmail.com>: > Hi all, > > I want to write a function that takes as param a comma separated values > string and perform a select matching these values. > > Here is the string '1,3,7,8' > > And I wan to perform a : SELECT * FROM my_table WHERE id IN (1, 3, 7, 8); > > Does anyone have a clue ? > > Thanks > > Nacef > -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql