Re: Order by email address by domain ? - Mailing list pgsql-sql

From Frank Bax
Subject Re: Order by email address by domain ?
Date
Msg-id 3.0.6.32.20010510215301.01ec9b50@pop6.sympatico.ca
Whole thread Raw
In response to Order by email address by domain ?  (Hervé Piedvache <herve@elma.fr>)
List pgsql-sql
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
>


pgsql-sql by date:

Previous
From: Keith Gray
Date:
Subject: Escape Quotes
Next
From: Tom Lane
Date:
Subject: Re: Escape Quotes