<div dir="auto"><div>Use a window function to find where outflow =< inflow with the window on the nodeid.<br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu., Jun. 9, 2022, 5:28 a.m. Shaozhong SHI, <<a href="mailto:shishaozhong@gmail.com">shishaozhong@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr">There is a table full of grouped values like the following<div><br></div><div>nodeid     link_type      primary</div><div><div>11           outflowlink       1</div><div>11              inflowlink      1</div><div>11              outflowlink     2</div></div><div><br></div><div>Primary of 1 indicates a primary water course.  Primary of 2 indicates a secondary water course.</div><div><br></div><div>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.</div><div><br></div><div>How can a function can be designed to find and report such errors?</div><div><br></div><div>Regards,</div><div><br></div><div>David</div></div></div>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank" rel="noreferrer">postgis-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-users</a><br>
</blockquote></div></div></div>