Bug in my ( newbie ) mind?
Dan Lyke <danlyke@flutterby.com>
From: Dan Lyke <danlyke@flutterby.com>
To: Christopher Sawtell <csawtell@xtra.co.nz>
Cc: PostgreSQL-General <pgsql-general@postgresql.org>
Date: 2001-02-21T06:03:39Z
Lists: pgsql-general
Christopher Sawtell writes: > chris=# select phone_prefix.prefix order by random() limit 1 || '-' || > lpad((random()*10000)::int, 4, '0')::text as "Phone Number"; > ERROR: parser: parse error at or near "||" This sure won't fix everything, but at the very least you need to parenthesize that first select clause inside another select. For instance, this works: select (select '123'::text) || (select '456'::text); So one might think that, with appropriate casting, something more like: select (select phone_prefix.prefix order by random() limit 1) || ... would be more likely to work (modulo some casting and such). Dan