Great not stupid :)
Juste a bug need +1, if there no +1 @ caractere is taken...
SELECT MID(email, LOCATE("@", email)+1, 999) AS domain, COUNT
(*) FROM
email_table GROUP BY domain;
Thanks a lot.
> ---------- Debut du message initial -----------
>
> De : Jon Barker <[EMAIL PROTECTED]>
> A : [EMAIL PROTECTED], [EMAIL PROTECTED]
> Copies :
> Date : Thu, 12 Jul 2001 13:43:09 +0000
> Objet : Re: Regexp / Sql-perl problem.
>
>
> 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--
> >
>
>
>