Re: Finding sequential records

Поиск
Список
Период
Сортировка
От Richard Broersma
Тема Re: Finding sequential records
Дата
Msg-id 396486430809261212o61b9bbbdhf444ab0b23036fb@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Finding sequential records  ("Richard Broersma" <richard.broersma@gmail.com>)
Список pgsql-sql
oops I noticed I forgot the having clause:

>  SELECT id
>     FROM Dummy
> GROUP BY name, fkey_id
Having count(*) > 1;


> SELECT A.*
>  FROM ( SELECT ID
>                  FROM Dummy
>             GROUP BY name, fkey_id              HAVING count(*) > 1 ) AS A
> INNER JOIN Dummy AS D
>              ON A.id - 1 = D.id
>              OR A.id + 1 = D.id;


-- 
Regards,
Richard Broersma Jr.

Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug


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

Предыдущее
От: Lennin Caro
Дата:
Сообщение: Re: Problem with pg_connect() in PHP
Следующее
От: Steve Midgley
Дата:
Сообщение: Re: Finding sequential records