Search Postgresql Archives

finding duplicate numbers in a select distinct statement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello all,

I am trying to do the following query but I would like to know how
many rows were deduplicated in the process:

psql -d foo -c 'SELECT DISTINCT ON (error) error,ev_text FROM
clients_event_log' -o fullfoo


For example, I would want the output to be the following where count
is the number of error rows that were deduplicated.

count    |   error    |   ev_text
55         |  525152 |   Some text
72         |  125124 |   Some other text

I imagine it's using the count function somewhere, just not sure how
to embed that.

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux