Re: SQL query - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: SQL query
Date
Msg-id 20050211133953.GB5110@wolff.to
Whole thread Raw
In response to SQL query  (David Goodenough <david.goodenough@btconnect.com>)
Responses Re: SQL query  (David Goodenough <david.goodenough@btconnect.com>)
List pgsql-general
On Fri, Feb 11, 2005 at 11:07:24 +0000,
  David Goodenough <david.goodenough@btconnect.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.

pgsql-general by date:

Previous
From: John DeSoi
Date:
Subject: Re: a few doubts regarding postgres
Next
From: Terry Lee Tucker
Date:
Subject: Re: a few doubts regarding postgres