pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Frank Bax <fbax@sympatico.ca>
To: pgsql-sql@postgresql.org
Cc: herve@elma.fr
Subject: Re: Order by email address by domain ?
Date: Thu, 10 May 2001 21:53:01 -0400
Message-ID: <3.0.6.32.20010510215301.01ec9b50@pop6.sympatico.ca> (raw)
In-Reply-To: <3AFADFFD.E6EF7225@elma.fr>

Why is everyone else suggesting new functions?  This works (in 6.5.3):

   ORDER BY lower(substring(email from position('@' in email)+1 )),
lower(email)

remove the lower() functions if you don't need them (I had mixed case
addresses).

I am guessing/assuming that it's cheaper to just use entire email address
in second key rather than extract before the '@' character.

Frank

At 08:37 PM 5/10/01 +0200, you wrote:
>Hi,
>
>I just want to order by a listing of email address by domain like :
>
>toto@aol.com
>tutu@aol.com
>toto@be.com
>tutu@be.com
>toto@yahoo.com
>
>Is it possible and how ?
>
>Thanks !
>-- 
>Hervé Piedvache
>
>Elma Ingenierie Informatique
>6, rue du Faubourg Saint-Honoré
>F-75008 - Paris - France 
>http://www.elma.fr
>Tel: +33-1-44949901
>Fax: +33-1-44949902 
>Email: herve@elma.fr
>
>---------------------------(end of broadcast)---------------------------
>TIP 6: Have you searched our list archives?
>
>http://www.postgresql.org/search.mpl
>



view thread (6+ messages)  latest in thread

Message-ID: <3.0.6.32.20010510215301.01ec9b50@pop6.sympatico.ca>
Permalink:  ../3.0.6.32.20010510215301.01ec9b50@pop6.sympatico.ca/
Also on:    postgresql.org/message-id/3.0.6.32.20010510215301.01ec9b50@pop6.sympatico.ca

 · 

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-sql@postgresql.org
  Cc: fbax@sympatico.ca, herve@elma.fr
  Subject: Re: Order by email address by domain ?
  In-Reply-To: <3.0.6.32.20010510215301.01ec9b50@pop6.sympatico.ca>
  References: <3AFADFFD.E6EF7225@elma.fr> <3.0.6.32.20010510215301.01ec9b50@pop6.sympatico.ca>

* 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