I assume that you want to do this within the database, i.e. with a query.
You would need to use a function, but I don't think a builtin function would
do it.
Try:
CREATE FUNCTION email_order (text) RETURNS text AS '
select substr ($1, strpos ($1, ''@'') + 1) || substr ($1, 1, strpos ($1,
''@'') -1)
' LANGUAGE 'sql';
Then do: 
SELECT ..... FROM ... ORDER BY email_order (fieldname);
I am assuming text datatype; substitute as appropriate.
That's doubled single quotes around the @ symbol, by the way.

> -----Original Message-----
> From: Hervé Piedvache [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, May 10, 2001 1:38 PM
> To:   [EMAIL PROTECTED]
> Subject:      Order by email address by domain ?
> 
> Hi,
> 
> I just want to order by a listing of email address by domain like :
> 
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> 
> 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: [EMAIL PROTECTED]
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
> http://www.postgresql.org/search.mpl

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly

Reply via email to