Re: finding duplicate numbers in a select distinct statement

From: Terry <td3201(at)gmail(dot)com>
To: Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>
Cc: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: finding duplicate numbers in a select distinct statement
Date: 2010-03-03 15:02:32
Message-ID: 8ee061011003030702m47cd99c7ga1f6f6f63db0dc72@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2010/3/3 Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>:
> select count(*) AS count, error, ev_text FROM clients_event_log GROUP BY
> error, ev_text;
>
> you can add 'HAVING count(*) > X'; , if you want to see only those with
> count above X, etc.
>
>
> --
> GJ
>

I was just about to reply to the group. Would this work too?
psql -d foo -c 'SELECT COUNT(DISTINCT(error)) AS count,error,ev_text
FROM dsclient_logs WHERE ev_id > 23572151 GROUP BY error,ev_text'

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Grzegorz Jaśkiewicz 2010-03-03 15:03:55 Re: finding duplicate numbers in a select distinct statement
Previous Message Grzegorz Jaśkiewicz 2010-03-03 15:00:34 Re: finding duplicate numbers in a select distinct statement