<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Arial Narrow'; COLOR: #00002b; FONT-SIZE: 12pt">
<DIV>Hi</DIV>
<DIV> </DIV>
<DIV>I am attempting to establish the number of geometries intersecting various 
polygons and relating the number of geometries to the id of each polygon.</DIV>
<DIV> </DIV>
<DIV>The below works for a single known polygon.</DIV>
<DIV> </DIV>
<DIV>        select  coalesce 
(sum(st_numgeometries(foo.edge_data.geom)), 0) </DIV>
<DIV>        from foo1, foo.edge_data</DIV>
<DIV>       where 
st_intersects(foo.edge_data.geom, foo1.five)</DIV>
<DIV>       and foo1.id = 58</DIV>
<DIV></DIV>
<DIV>(returns 0)</DIV>
<DIV> </DIV>
<DIV>However I would like to select all the polygons and choose only those 
intersected by zero or one geometry.</DIV>
<DIV> </DIV>
<DIV>But in the following, as soon as I use the” group by” clause, does not 
return the coalesced null values, it only returns geometries numbering 1 or 
more.</DIV>
<DIV> </DIV>
<DIV>    select coalesce 
(sum(st_numgeometries(foo.edge_data.geom)), 0),  foo1.id</DIV>
<DIV>    from foo1, foo.edge_data</DIV>
<DIV>    where st_intersects(foo.edge_data.geom, foo1.five)</DIV>
<DIV>    and foo1.id = foo1.id</DIV>
<DIV>    group by foo1.id</DIV>
<DIV> </DIV>
<DIV>Is there any way of reworking this to obtain polygon ids with null valued 
intersections??</DIV>
<DIV> </DIV>
<DIV>Bob</DIV></DIV></DIV></BODY></HTML>