A function to find errors in groups in a table

Поиск
Список
Период
Сортировка
От Shaozhong SHI
Тема A function to find errors in groups in a table
Дата
Msg-id CA+i5JwboSVnpFO6cvPP169gw-OXWVa5jQ34FXdk54t+L54h6Aw@mail.gmail.com
обсуждение исходный текст
Список pgsql-general
There is a table full of grouped values like the following

nodeid     link_type      primary
11           outflowlink       1
11              inflowlink      1
11              outflowlink     2

Primary of 1 indicates a primary water course.  Primary of 2 indicates a secondary water course.

Obviously, one of the out flow links is an error, as its primacy value is 2.  It is wrong that water flows from a primary water course into a secondary water course.

How can a function can be designed to find and report such errors?

Regards,

David

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

Предыдущее
От: Lucas
Дата:
Сообщение: Cluster OID Limit
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Cluster OID Limit