Your query is definetely broken - bad SQL .... perhaps you mean something more 
like:

DATA "the_geom from (SELECT arch2.oid AS oid, *
FROM arch2 LEFT JOIN req375 ON arch2.bordennumb =
req375.BORDEN) AS join_arch USING UNIQUE oid USING SRID=-1"

if you continue having errors after you fix your SQL, you may need to try 
alternating the case of "USING UNIQUE" and "USING SRID" to "using unique" 
and "using srid" - some of Dave's code in the mapserver connector was case-
sensitive for a while, and I'm not sure in which version it got fixed.

Chris

Quoting Randy James <rjames57@yahoo.com>:

> Hi
> 
> I am attempting to join two tables but keep getting errors.
> Can anyone tell me what i am doing wrong? I can get the
> layer to display, but when i try and join another table to
> it i get an error. I'm using mapserver 3.7 and postgis
> 0.7.3 and postgresql 7.2.3
> 
> 
> My map file portion that creates the error. (all on one
> line)
> 
>  DATA "the_geom from (SELECT  oid, * from arch2 as oid,
> from arch2 LEFT JOIN req375 ON arch2.bordennumb =
> req375.BORDEN) AS join_arch USING UNIQUE oid USING SRID=-1"
> 
> The error returned to me:
> 
> prep_DB(): Query error. Error executing POSTGIS DECLARE
> (the actual query) statement: 'DECLARE mycursor BINARY
> CURSOR FOR SELECT
> asbinary(force_collection(force_2d(the_geom)),'NDR'),oid::text
> from (SELECT oid, * from arch2 as oid, from arch2 LEFT JOIN
> req375 ON arch2.bordennumb = req375.BORDEN) AS join_arch
> WHERE the_geom && setSRID('BOX3D(351340.426
> 5467761,682372.574 5682854)'::BOX3D,
> find_srid('','arch2','the_geom') )'
> 
> Postgresql reports the error 'ERROR: parser: parse error at
> or near "from" '
> 
> Cheers
> Randy
> 
> __________________________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo
> http://search.yahoo.com
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 





