<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div>Hi Julien,<br></div><div><br></div><div>&gt; I usually use a view, but in this case there are a lot of tables <br>&gt; involved and I would like to avoid dozens of unnecessary JOIN<br></div><div><br></div><div>I think that you have a database design problem.</div><div><br></div><div>You can have a lot of tables which concerns to a different objects, but you need to show some information on a map which involves many of those tables. That's why you have to create different views or in the worst case, a super view as a spreadsheet.</div><div><br></div><div>I guess that's why you're talking about unnecessary JOINs, but in the end, you'll need to use them to create the multiple data sources or the super data source of your layers in the .MAP file.<br></div><br><div><font class="yui_3_2_0_17_132828563829552" style="font-weight: bold; color:
 rgb(0, 96, 191); font-family: verdana,helvetica,sans-serif;" size="2"><br></font></div><div><font style="font-weight:bold;color:rgb(0, 96, 191);font-family:verdana, helvetica, sans-serif;" size="2">IC Carlos Ruiz</font><br><br></div>  <div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> Julien Cigar &lt;jcigar@ulb.ac.be&gt;<br> <b><span style="font-weight: bold;">To:</span></b> Carlos Ruiz &lt;boolean10001@yahoo.com&gt; <br><b><span style="font-weight: bold;">Cc:</span></b> "mapserver-users@lists.osgeo.org" &lt;mapserver-users@lists.osgeo.org&gt; <br> <b><span style="font-weight: bold;">Sent:</span></b> Wednesday, February 1, 2012 2:59 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [mapserver-users] PostGIS query<br>
 </font> </div> <br>
On 01/31/2012 17:05, Carlos Ruiz wrote:<br>&gt; Julien,<br><br>Hi Carlos,<br><br>&gt;<br>&gt; Have you tried with views ? When I need to map complex queries I build a<br>&gt; view to just handle the where clauses.<br>&gt;<br><br>I usually use a view, but in this case there are a lot of tables <br>involved and I would like to avoid dozens of unnecessary JOIN<br><br>&gt; Cheers from México<br>&gt; IC Carlos Ruiz<br>&gt;<br>&gt; ------------------------------------------------------------------------<br>&gt; *From:* Julien Cigar &lt;<a ymailto="mailto:jcigar@ulb.ac.be" href="mailto:jcigar@ulb.ac.be">jcigar@ulb.ac.be</a>&gt;<br>&gt; *To:* "<a ymailto="mailto:mapserver-users@lists.osgeo.org" href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>" &lt;<a ymailto="mailto:mapserver-users@lists.osgeo.org" href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>&gt;<br>&gt; *Sent:* Tuesday, January 31, 2012 6:38
 AM<br>&gt; *Subject:* [mapserver-users] PostGIS query<br>&gt;<br>&gt; Hello,<br>&gt;<br>&gt; Is there a way to (deeply) modify the SQL query in a PostGIS layer?<br>&gt; I would like to add some JOIN, additional WHERE clauses, etc<br>&gt; As I'm afraid that "Run-time Substitution" isn't flexible enough for<br>&gt; this case ... is there any other possibility, other than mapscript?<br>&gt;<br>&gt; I guess there is no possibility to define variables, conditions, etc in<br>&gt; a .map file .. ?<br>&gt;<br>&gt; Thanks,<br>&gt; Julien<br>&gt;<br>&gt; -- No trees were killed in the creation of this message.<br>&gt; However, many electrons were terribly inconvenienced.<br>&gt;<br>&gt; _______________________________________________<br>&gt; mapserver-users mailing list<br>&gt; <a ymailto="mailto:mapserver-users@lists.osgeo.org" href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a> &lt;mailto:<a
 ymailto="mailto:mapserver-users@lists.osgeo.org" href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>&gt;<br>&gt; http://lists.osgeo.org/mailman/listinfo/mapserver-users<br>&gt;<br>&gt;<br><br><br>-- <br>No trees were killed in the creation of this message.<br>However, many electrons were terribly inconvenienced.<br><br><br> </div> </div>  </div></body></html>