Re: SQL query

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: David Goodenough <david(dot)goodenough(at)btconnect(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: SQL query
Date: 2005-02-11 13:39:53
Message-ID: 20050211133953.GB5110@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Feb 11, 2005 at 11:07:24 +0000,
David Goodenough <david(dot)goodenough(at)btconnect(dot)com> wrote:
>
> I thought of using an inner select for the join, and using limit 1 to
> get just the one, and forcing the order by to give me the billing
> address by preference, but I am then dependant on the sort order
> of the particular type values I am selecting from.

You can order by boolean expressions such as type = 'billing'.
You can use that with LIMIT or DISTINCT ON to get just the address you want.

In response to

  • SQL query at 2005-02-11 11:07:24 from David Goodenough

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Terry Lee Tucker 2005-02-11 14:07:07 Re: a few doubts regarding postgres
Previous Message John DeSoi 2005-02-11 13:11:11 Re: a few doubts regarding postgres