On Tue, 21 Aug 2007 20:15:59 +0200 "Pavel Stehule" <pavel.stehule@xxxxxxxxx> wrote: > SELECT * FROM ... WHERE 1000 IN (SELECT pb_ids FROM pb WHERE id=123) > > or > > SELECT * FROM ... WHERE 1000 = ANY(ARRAY(SELECT pb_ids FROM pb > WHERE id=123)) Thanks - another way: SELECT * FROM ... WHERE 1000 = ANY((SELECT pb_ids FROM pb WHERE id=123)::integer[]) Josh ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match