Re: A function to find errors in groups in a table
От | Steve Midgley |
---|---|
Тема | Re: A function to find errors in groups in a table |
Дата | |
Msg-id | CAJexoSJ3g9W1XtdUVnss+5cw=r-ek-JSfiGUaBxCGG=BJLmHQQ@mail.gmail.com обсуждение исходный текст |
Ответ на | A function to find errors in groups in a table (Shaozhong SHI <shishaozhong@gmail.com>) |
Ответы |
Re: A function to find errors in groups in a table
|
Список | pgsql-sql |
On Thu, Jun 9, 2022 at 6:37 AM Shaozhong SHI <shishaozhong@gmail.com> wrote:
There is a table full of grouped values like the followingnodeid link_type primary11 outflowlink 111 inflowlink 111 outflowlink 2Primary 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?
11 outflowlink 2
But there is no corresponding row:
11 inflowlink 2
So that you need to find all "orphan" rows that don't have a corresponding member with the opposing data field inflowlink or outflowlink where the "primary" column is the join field between the two rows?
Thanks for clarifying your problem,
Steve
В списке pgsql-sql по дате отправления: