<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2912" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Thanks Aaron, I choose option number 2 and included 
a JOIN statement like this:</FONT></DIV>
<DIV><FONT size=2>
<P>DATA "posicion from (select loca.cmpoid, loca.mo, loca.posicion, autos.placas 
as placa from loca inner join autos on loca.idunit = autos.idunit where %uad%) 
as foo using unique cmpoid using srid=4326"</P>
<P>the %uad% is for filtering purposes.</P></FONT></DIV>
<DIV><FONT face=Arial size=2>works OK</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Regards,</FONT></DIV>
<DIV><FONT face=Arial size=2>Luis</FONT></DIV>
<DIV>----- Original Message ----- </DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=aaronkoning@GMAIL.COM href="mailto:aaronkoning@GMAIL.COM">Aaron 
  Koning</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A 
  title=MAPSERVER-USERS@LISTS.UMN.EDU 
  href="mailto:MAPSERVER-USERS@LISTS.UMN.EDU">MAPSERVER-USERS@LISTS.UMN.EDU</A> 
  </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Monday, June 19, 2006 3:24 PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [UMN_MAPSERVER-USERS] How 
  can I label a Point using different postgis table</DIV>
  <DIV><BR></DIV>I believe you have two options here:<BR><BR>1. Create a 
  database view that joins the two tables and set your DATA variable to that 
  view.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OR<BR>2. 
  Modify the DATA variable to include a JOIN statement.<BR><BR>Aaron <BR><BR>
  <DIV><SPAN class=gmail_quote>On 6/19/06, <B class=gmail_sendername>Luis 
  Treviņo Huerta</B> &lt;<A 
  href="mailto:ltrevino@gpobsi.com.mx">ltrevino@gpobsi.com.mx</A>&gt; 
  wrote:</SPAN>
  <BLOCKQUOTE class=gmail_quote 
  style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">Hi 
    list:<BR><BR>I'm currenttly using a point layer that displays some GPS 
    points that are<BR>stored on a postgis table called "loca". I'd like to 
    label this points with<BR>data that comes from another table in the same 
    postgis data base (this table <BR>is named "autos"), both tables share a 
    common column named "idunit" and I<BR>would like to use autos.idunit as a 
    label. How can I do this?. This is part<BR>of my map 
    file:<BR><BR>LAYER<BR>&nbsp;&nbsp; NAME gis <BR>&nbsp;&nbsp; STATUS 
    ON<BR>&nbsp;&nbsp; TYPE POINT<BR>&nbsp;&nbsp; UNITS 
    METERS<BR><BR>&nbsp;&nbsp; DEBUG ON<BR>&nbsp;&nbsp; CONNECTION "user=XXX 
    password=XXXXX dbname=bsiubica 
    host=XXX.XXX.XXX.XX<BR>port=5432"<BR>&nbsp;&nbsp; CONNECTIONTYPE 
    postgis<BR>&nbsp;&nbsp; DATA "posicion from loca as foo using unique cmpoid 
    using srid=4326" <BR><BR>&nbsp;&nbsp; 
    PROJECTION<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"proj=longlat"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"ellps=WGS84"<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
    "datum=WGS84"<BR>&nbsp;&nbsp; END<BR><BR>&nbsp;&nbsp;FILTER 'idunit = 
    %unid%'<BR><BR>&nbsp;&nbsp; CLASS<BR>&nbsp;&nbsp;&nbsp;&nbsp; EXPRESSION 
    ('[mo]' = '1')<BR>&nbsp;&nbsp;&nbsp;&nbsp; COLOR 255 255 
    26&nbsp;&nbsp;#amarillo <BR>&nbsp;&nbsp;&nbsp;&nbsp; SYMBOL 
    7<BR>&nbsp;&nbsp;&nbsp;&nbsp; SIZE 13<BR>&nbsp;&nbsp; 
    END<BR>END<BR><BR>regards,<BR>Luis<BR></BLOCKQUOTE></DIV><BR><BR 
  clear=all><BR>-- 
  <BR>+--------------------------------------------<BR>|&nbsp;&nbsp;Aaron 
  Koning<BR>|&nbsp;&nbsp;Information Technologist <BR>|&nbsp;&nbsp;Prince 
  George, BC, 
  Canada.<BR>+--------------------------------------------<BR>|&nbsp;&nbsp;<A 
  href="http://datashare.gis.unbc.ca/fist/">http://datashare.gis.unbc.ca/fist/</A><BR>|&nbsp;&nbsp;<A 
  href="http://datashare.gis.unbc.ca/gctp-js/"> 
  http://datashare.gis.unbc.ca/gctp-js/</A><BR>+-------------------------------------------- 
</BLOCKQUOTE></BODY></HTML>