Re: Extracting hostname from URI column - Mailing list pgsql-sql

From Paul Lambert
Subject Re: Extracting hostname from URI column
Date
Msg-id 46E762B4.7080102@autoledgers.com.au
Whole thread Raw
In response to Re: Extracting hostname from URI column  (ogjunk-pgjedan@yahoo.com)
Responses Re: Extracting hostname from URI column
List pgsql-sql
ogjunk-pgjedan@yahoo.com wrote:
> 
> And what I'd like is something that would give me the counts for the number of occurrences of each unique hostname.
Somethingmuch like `uniq -c'.  Can anyone tell me how that's done or where I should look for info? (I'm not sure what
tolook for, that's the problem).
 
> 
> Thanks,
> Otis
> 

Just use distinct...

test=# select distinct count(*),substring( href from '.*://([^/]*)' ) as 
domain from url group by domain order by domain; count |          domain
-------+--------------------------     3 | devedge.netscape.com     1 | dictionary.reference.com     2 |
forums.mozillazine.org    1 | groups.google.com     4 | texturizer.net    11 | www.google.com     2 |
www.mozillazine.org
(7 rows)

-- 
Paul Lambert
Database Administrator
AutoLedgers


pgsql-sql by date:

Previous
From: chester c young
Date:
Subject: Re: Extracting hostname from URI column
Next
From: chester c young
Date:
Subject: Re: Extracting hostname from URI column