<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>

That was spot on, didn't need to change a thing<br>One part is still confusing me though, I need to show the offended line but when i try i get an error that i have to GROUP BY or use Aggregate function<br>So i decided to write like this but the min thing is an error that wont always be correct.<br><br>SELECT link_name,  from_node, b.link_diameter, offended_link, a.in_diameter  FROM<br>  (SELECT  to_node, min(link_name) AS offended_link, max(diameter) AS in_diameter FROM links GROUP BY to_node) AS a,<br>  (SELECT link_name, from_node, diameter AS link_diameter FROM links) AS b<br>WHERE a.to_node = b.from_node AND b.link_diameter < a.in_diameter;<br><br>The target here is: Link 10 from node7 is of size12 while the previous link 9 has size13 (Link 9 is one of the links that have node7 as their to_node).<br><br>Broun Uganda<br><br><br><hr>From: tekuganda@hotmail.com<br>To: postgis-users@postgis.refractions.net<br>Subject: Compare data in one table<br>Date: Sat, 30 Aug 2008 00:23:33 +0300<br><br>

<meta http-equiv="Content-Type" content="text/html; charset=unicode">
<meta name="Generator" content="Microsoft SafeHTML">
<style>
.ExternalClass .EC_hmmessage P
{padding:0px;}
.ExternalClass body.EC_hmmessage
{font-size:10pt;font-family:Tahoma;}
</style>


I am trying to develop a trigger function that searches for lines with particular properties. I have two or more lines joining at a point but only one line exiting from that point. I want to check that the size of the outgoing (exiting) line is always not smaller than incoming lines.<br>Take such data as example:<br>line_name from_point to_point size<br>line1        p1              p2          2<br>line2        p10             p2         3<br>line3        p2            p7            1<br>line4        p7            p8            3<br><br>Lines Line1 and Line2 join at point p2 (to_point), therefore line3 should have size at least equal to 3.<br>Tried to use this select statement but doesnt work, could anyone give me an idea<br>Select link_name, diameter, from_node, to_node from links as ends where ends.diameter< links.diameter;<br>or even<br>SELECT   from_node from links as dstream  intersect SELECT   to_node from links as previo ;<br><br>Thank you<br><br>Broun Uganda<br><br><hr>Discover the new Windows Vista <a href="http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE" target="_blank">Learn more!</a>
<br /><hr />Discover the new Windows Vista <a href='http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE' target='_new'>Learn more!</a></body>
</html>