finding duplicate numbers in a select distinct statement

Поиск
Список
Период
Сортировка
От Terry
Тема finding duplicate numbers in a select distinct statement
Дата
Msg-id 8ee061011003030649q4014c591k880fa81366457c36@mail.gmail.com
обсуждение исходный текст
Ответы Re: finding duplicate numbers in a select distinct statement  (Grzegorz Jaśkiewicz <gryzman@gmail.com>)
Список pgsql-general
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.

В списке pgsql-general по дате отправления:

Предыдущее
От: akp geek
Дата:
Сообщение: Re: FSM and VM file
Следующее
От: Kevin Kempter
Дата:
Сообщение: Re: How to grant a user read-only access to a database?