I don't necessarily understand all of your query, but consider: <br>+ the DISTINCT keyword for when you're joining tables that might multiply records.<br>+ I don't see the graphics.spatial_ref joined - could it be a join is missing?<br>
Mark<br><br><br><div class="gmail_quote">On Thu, Aug 20, 2009 at 12:33 PM, Bob Pawley <span dir="ltr"><<a href="mailto:rjpawley@shaw.ca">rjpawley@shaw.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff">
<div><font size="2" face="Arial">Hi </font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">When I use this expression I get results that are
not correct. (More rows than the table p_id.image contains)</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">select count</font></div>
<div><font size="2" face="Arial"> (p_id.image.the_geom) <br> from
p_id.image, processes_count , p_id.p_id ,
graphics.spatial_ref<br> where p_id.image.p_id_id =
processes_count.p_id_id<br> and p_id.image.description = 'ip_op_Arrow_name'
<br> and p_id.image.the_geom |>>
p_id.p_id.ithe_geom<br> and p_id.image.the_geom <<
p_id.p_id.one <br> and p_id.p_id.process_number = '1'
<br> and p_id.p_id.p_id_id = processes_count.p_id_id;</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">However, when I use the limited</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">
<div><font size="2" face="Arial">select count</font></div>
<div><font size="2" face="Arial"> (p_id.image.the_geom) <br> from
p_id.image, processes_count <br> where p_id.image.p_id_id
= processes_count.p_id_id<br> and p_id.image.description =
'ip_op_Arrow_name' ;</font></div>
<div> </div>
<div>the correct results are obtained.</div>
<div> </div>
<div>It woiuld appear that rows in other tables are being counted when I attempt
to limit the return.</div>
<div> </div>
<div>Can anyone suggest a workaround?/</div>
<div> </div><font color="#888888">
<div>Bob</div></font></font></div></div>
<br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
<br></blockquote></div><br>