| From: | Paul Lambert <paul(dot)lambert(at)autoledgers(dot)com(dot)au> |
|---|---|
| To: | pgsql-sql(at)postgresql(dot)org |
| Subject: | Re: Extracting hostname from URI column |
| Date: | 2007-09-12 04:03:07 |
| Message-ID: | 46E764FB.2070602@autoledgers.com.au |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-sql |
Paul Lambert wrote:
>
> Just use distinct...
>
> test=# select distinct count(*),substring( href from '.*://([^/]*)' ) as
> domain from url group by domain order by domain;
OK so distinct was redundant there... it gives the same results without it.
AutoDRS=# select count(*) as occurances,substring( href from
'.*://([^/]*)' ) as domain from url group by domain order by occurances
desc,domain;
occurances | domain
------------+--------------------------
11 | www.google.com
4 | dictionary.reference.com
4 | texturizer.net
3 | devedge.netscape.com
3 | groups.google.com
2 | forums.mozillazine.org
2 | www.mozillazine.org
(7 rows)
--
Paul Lambert
Database Administrator
AutoLedgers
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Alvaro Herrera | 2007-09-12 12:52:03 | Re: Extracting hostname from URI column |
| Previous Message | ogjunk-pgjedan | 2007-09-12 03:58:16 | Re: Extracting hostname from URI column |