On Wed, 21 Feb 2001, Christopher Sawtell wrote:
> chris=# select phone_prefix.prefix order by random() limit 1 || '-' ||
> lpad((random()*10000)::int, 4, '0')::text as "Phone Number";
All the things you are selecting need to come in the first part of the
query.
like,
SELECT prefix || '-' || lpad((random()*10000)::int, 4, '0')::text as
"Phone Number" from phone_prefix order by random() limit 1;
--
Tod McQuillin