pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: David Goodenough <david.goodenough@btconnect.com>
Cc: pgsql-general@postgresql.org
Subject: Re: SQL query
Date: Fri, 11 Feb 2005 07:39:53 -0600
Message-ID: <20050211133953.GB5110@wolff.to> (raw)
In-Reply-To: <200502111107.25004.david.goodenough@btconnect.com>
References: <200502111107.25004.david.goodenough@btconnect.com>

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.



view thread (45+ messages)  latest in thread

Message-ID: <20050211133953.GB5110@wolff.to>
Permalink:  ../20050211133953.GB5110@wolff.to/
Also on:    postgresql.org/message-id/20050211133953.GB5110@wolff.to

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: bruno@wolff.to, david.goodenough@btconnect.com
  Subject: Re: SQL query
  In-Reply-To: <20050211133953.GB5110@wolff.to>
  References: <200502111107.25004.david.goodenough@btconnect.com> <20050211133953.GB5110@wolff.to>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox