| From: | Frank Bax <fbax(at)sympatico(dot)ca> |
|---|---|
| To: | pgsql-sql(at)postgresql(dot)org |
| Cc: | herve(at)elma(dot)fr |
| Subject: | Re: Order by email address by domain ? |
| Date: | 2001-05-11 01:53:01 |
| Message-ID: | 3.0.6.32.20010510215301.01ec9b50@pop6.sympatico.ca |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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(at)aol(dot)com
>tutu(at)aol(dot)com
>toto(at)be(dot)com
>tutu(at)be(dot)com
>toto(at)yahoo(dot)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(at)elma(dot)fr
>
>---------------------------(end of broadcast)---------------------------
>TIP 6: Have you searched our list archives?
>
>http://www.postgresql.org/search.mpl
>
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2001-05-11 02:34:03 | Re: Escape Quotes |
| Previous Message | Keith Gray | 2001-05-11 01:11:46 | Escape Quotes |