Re: Extracting hostname from URI column

Поиск
Список
Период
Сортировка
От Paul Lambert
Тема Re: Extracting hostname from URI column
Дата
Msg-id 46E762B4.7080102@autoledgers.com.au
обсуждение исходный текст
Ответ на Re: Extracting hostname from URI column  (ogjunk-pgjedan@yahoo.com)
Ответы Re: Extracting hostname from URI column  (Paul Lambert <paul.lambert@autoledgers.com.au>)
Список 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 по дате отправления:

Предыдущее
От: chester c young
Дата:
Сообщение: Re: Extracting hostname from URI column
Следующее
От: chester c young
Дата:
Сообщение: Re: Extracting hostname from URI column