In mysql you could do something like :

SELECT MID(email, LOCATE("@", email), 999) AS domain, COUNT(*) FROM 
email_table GROUP BY domain;

I'm not sure about MID and LOCATE in other renditions of SQL though.

Jon

> ------_=_NextPart_001_01C10ACA.0C606500
> Content-Type: text/plain
> 
> Salut,
> 
> > How should i extract : tata.com, titi.com, and may by count them ?
> > If you have an idea you'll be verry happy !
> > 
> > The other way could be to select all email adresse and regex 
> > them do ++ count, and them display, but later it'll take to much of time
> :/
> 
> As you say, I would loop:
>       while (rows) {
>               regexp out $domain
>               $hash{$domain}++;
>       }
>       foreach $domain (keys %hash) ... etc
> 
> 
> If the characteristics of your table are that there are multiple occurrences
> of each email address you should select count(*),email from ... group by
> email
> and modify the ++ accordingly. This would retrieve less rows at the expense
> of more DB work.
> 
> Bonne chance,
> 
> --Rich
> 
> ------_=_NextPart_001_01C10ACA.0C606500--
> 


Reply via email to