thanks, interestingly your method works in both Oracle and PostgreSQL,albeit with a different random function call.It does not work in SQL Anywhere though.
--Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html