Hi,<br><br>A while back, I posted a question like this to the group, and got an answer that worked for me:<br><span class="HcCDpe"><br><a href="http://lists.umn.edu/cgi-bin/wa?A2=ind0705&amp;L=mapserver-users&amp;D=0&amp;O=D&amp;T=0&amp;P=5373">http://lists.umn.edu/cgi-bin/wa?A2=ind0705&amp;L=mapserver-users&amp;D=0&amp;O=D&amp;T=0&amp;P=5373</a><br>
<br>I was able to get correct results by making a simple query.&nbsp; Now, however, I need to use a more complex query to return results.<br><br>The problem is this... I have a template and a map file with a layer that uses that template.&nbsp; When the DATA attribute is:<br>
<br>&nbsp;&nbsp;&nbsp; DATA &quot;the_geom from shp_prct&quot;<br><br>the query works fine and i get my template back appropriately filled out.&nbsp; When I use the more complex but equivalent formulation:<br><br>&nbsp;&nbsp;&nbsp; DATA &quot;the_geom from (select the_geom from shp_prct) as foo using unique the_geom using SRID=-1&quot;<br>
<br>The result is the following:<br><br></span><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote"><pre id="line1">Content-type: text/html<br><br>
&lt;<span class="start-tag">HTML</span>&gt;<br>&lt;<span class="start-tag">HEAD</span>&gt;&lt;<span class="start-tag">TITLE</span>&gt;MapServer Message&lt;/<span class="end-tag">TITLE</span>&gt;&lt;/<span class="end-tag">HEAD</span>&gt;<br>
<span class="comment">&lt;!-- MapServer version 5.0.0 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=PDF OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE --&gt;</span><br>
&lt;<span class="start-tag">BODY</span><span class="attribute-name"> BGCOLOR</span>=<span class="attribute-value">&quot;#FFFFFF&quot;</span>&gt;<br>&lt;/<span class="end-tag">BODY</span>&gt;&lt;/<span class="end-tag">HTML</span>&gt;</pre>
</blockquote><br>Just to note, the query I really need isn&#39;t the second one verbatim, but uses the form of &quot;select the geom from (&lt;query&gt;) as foo ...&quot;.<br><br>I&#39;m omitting the rest of the info assuming it isn&#39;t important at this time, but will supply it if someone thinks that it is key to solving this...<br>
<br>Any ideas?<br><br>Thanks,<br>Matt<br><span class="HcCDpe"><br clear="all"></span><br>-- <br>It is from the wellspring of our despair and the places that we are broken that we come to repair the world.<br>-- Murray Waas