Re: Bug in my ( newbie ) mind?

From: Tod McQuillin <devin(at)spamcop(dot)net>
To: Christopher Sawtell <csawtell(at)xtra(dot)co(dot)nz>
Cc: PostgreSQL-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Bug in my ( newbie ) mind?
Date: 2001-02-21 05:34:31
Message-ID: Pine.GSO.4.31.0102202332430.13057-100000@sysadmin
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dan Lyke 2001-02-21 06:03:39 Bug in my ( newbie ) mind?
Previous Message Chris Czeyka 2001-02-21 05:09:49 Re: two tables - foreign keys referring to each other...