pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Paul Lambert <paul.lambert@autoledgers.com.au>
To: pgsql-sql@postgresql.org
Subject: Re: Extracting hostname from URI column
Date: Wed, 12 Sep 2007 12:03:07 +0800
Message-ID: <46E764FB.2070602@autoledgers.com.au> (raw)
In-Reply-To: <46E762B4.7080102@autoledgers.com.au>
References: <750084.67431.qm@web50306.mail.re2.yahoo.com>
	<46E762B4.7080102@autoledgers.com.au>

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




view thread (17+ messages)  latest in thread

Message-ID: <46E764FB.2070602@autoledgers.com.au>
Permalink:  ../46E764FB.2070602@autoledgers.com.au/
Also on:    postgresql.org/message-id/46E764FB.2070602@autoledgers.com.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: paul.lambert@autoledgers.com.au
  Subject: Re: Extracting hostname from URI column
  In-Reply-To: <46E764FB.2070602@autoledgers.com.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox