<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Message</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2180" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=862513416-17112004><FONT face=Arial color=#0000ff size=2>I 
don't think this is what he wants as it will affect how many features are 
displayed in the map. Perhaps a "distinct" clause? </FONT></SPAN></DIV>
<DIV><SPAN class=862513416-17112004><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=862513416-17112004><FONT face=Arial color=#0000ff size=2>Also 
James are you sure gid is indeed unique for each place? I can't see why it would 
work like you expect at first glance. You may want to ask this on the mapserver 
email list.</FONT></SPAN></DIV>
<DIV><SPAN class=862513416-17112004><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=862513416-17112004><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=862513416-17112004><FONT face=Arial color=#0000ff 
size=2>-e</FONT></SPAN></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
  <DIV></DIV>
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT 
  face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> 
  postgis-users-bounces@postgis.refractions.net 
  [mailto:postgis-users-bounces@postgis.refractions.net] <B>On Behalf Of 
  </B>Purvis, Charlton<BR><B>Sent:</B> Wednesday, November 17, 2004 9:33 
  AM<BR><B>To:</B> 'PostGIS Users Discussion'<BR><B>Subject:</B> RE: 
  [postgis-users] Postgis Mapserver Query returns the same itemmultiple times. 
  <BR><BR></FONT></DIV>
  <P><FONT size=2>You could try adding 'limit 1' after the WHERE clause (I 
  think) if that is what you want.</FONT> </P>
  <P><FONT size=2>> -----Original Message-----</FONT> <BR><FONT size=2>> 
  From: James Martin [<A 
  href="mailto:martin426@yahoo.com">mailto:martin426@yahoo.com</A>]</FONT> 
  <BR><FONT size=2>> Sent: Wednesday, November 17, 2004 11:17 AM</FONT> 
  <BR><FONT size=2>> To: postgis-users@postgis.refractions.net</FONT> 
  <BR><FONT size=2>> Subject: [postgis-users] Postgis Mapserver Query returns 
  the same item</FONT> <BR><FONT size=2>> multiple times.</FONT> <BR><FONT 
  size=2>> </FONT><BR><FONT size=2>> Hello,</FONT> <BR><FONT size=2>> 
  </FONT><BR><FONT size=2>> Any help is greatly appreciated.</FONT> <BR><FONT 
  size=2>> </FONT><BR><FONT size=2>> I'm trying to perform an nquery using 
  the following</FONT> <BR><FONT size=2>> DATA statement in my mapfile 
  (formatted for e-mail):</FONT> <BR><FONT size=2>> </FONT><BR><FONT 
  size=2>> DATA = "the_geom from</FONT> <BR><FONT size=2>> (SELECT 
  place.the_geom AS the_geom,</FONT> <BR><FONT 
  size=2>>              
  place.gid AS gid,</FONT> <BR><FONT 
  size=2>>              
  place.name AS name</FONT> <BR><FONT 
  size=2>>              
  FROM place</FONT> <BR><FONT 
  size=2>>              
  WHERE place.gid=9)</FONT> <BR><FONT 
  size=2>>              
  AS foo USING UNIQUE place.gid</FONT> <BR><FONT 
  size=2>>              
  USING SRID=-1"</FONT> <BR><FONT size=2>> </FONT><BR><FONT size=2>> 
  Whenever I run this query on a map it works, that is</FONT> <BR><FONT 
  size=2>> to say there are no error messages and the information</FONT> 
  <BR><FONT size=2>> I'm expecting is returned.</FONT> <BR><FONT size=2>> 
  </FONT><BR><FONT size=2>> The problem is it returns the information 'N' 
  times,</FONT> <BR><FONT size=2>> where N is the number of rows in the place 
  table.</FONT> <BR><FONT size=2>> </FONT><BR><FONT size=2>> 
  </FONT><BR><FONT size=2>> </FONT><BR><FONT size=2>> 
  __________________________________________________</FONT> <BR><FONT 
  size=2>> Do You Yahoo!?</FONT> <BR><FONT size=2>> Tired of spam?  
  Yahoo! Mail has the best spam protection around</FONT> <BR><FONT size=2>> 
  <A href="http://mail.yahoo.com" target=_blank>http://mail.yahoo.com</A></FONT> 
  <BR><FONT size=2>> _______________________________________________</FONT> 
  <BR><FONT size=2>> postgis-users mailing list</FONT> <BR><FONT size=2>> 
  postgis-users@postgis.refractions.net</FONT> <BR><FONT size=2>> <A 
  href="http://postgis.refractions.net/mailman/listinfo/postgis-users" 
  target=_blank>http://postgis.refractions.net/mailman/listinfo/postgis-users</A></FONT> 
  </P></BLOCKQUOTE></BODY></HTML>