Re: Bug in my ( newbie ) mind? - Mailing list pgsql-general

From Tod McQuillin
Subject Re: Bug in my ( newbie ) mind?
Date
Msg-id Pine.GSO.4.31.0102202332430.13057-100000@sysadmin
Whole thread Raw
In response to Bug in my ( newbie ) mind?  (Christopher Sawtell <csawtell@xtra.co.nz>)
List pgsql-general
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



pgsql-general by date:

Previous
From: Christopher Sawtell
Date:
Subject: Bug in my ( newbie ) mind?
Next
From: Dan Lyke
Date:
Subject: Bug in my ( newbie ) mind?