下面这个JOIN语句不能执行,请大家帮助看一下,如何改正,在ACCESS中运行中提示JOIN有错误,如下图所示,点确定后,光标圈在 AS A处的AS上:
select * from
(
   (
     (select * from yhxx where 表号 = 1  and  户号 = 1) 
     as c 
   inner join 
    (select * from sdjl where 用户表号 = 1  and  用户户号 = 1 )
     as d 
   on C.表号 = D.用户表号 and c.户号 = d.用户户号 
    ) 
 as  A inner join
 yhlx 
 on A.用户类型 = yhlx.用户类型 )

解决方案 »

  1.   

    补充:
       把上面这个SQL语句的AS A去掉就可以正常执行,如果带AS A 的话,如何能保证这个SQL语句的正常执行呢。
      

  2.   

    http://download.csdn.net/source/1644211
      

  3.   


    select * from (select * from 
       (select * from yhxx where 表号 = 1  and  户号 = 1)  as c 
      inner join 
        (select * from sdjl where 用户表号 = 1  and  用户户号 = 1 ) as d  on C.表号 = d.用户表号 and c.户号 = d.用户户号) as a
      inner join 
         yhlx on A.用户类型 = yhlx.用户类型 如果多张表有重复字段请不要用*来出字段,改用a.表号,yhlx.用户类型,...来出库。
      

  4.   

    select * from 
      ( 
        (select * from yhxx where 表号 = 1  and  户号 = 1) 
        as c 
      inner join 
        (select * from sdjl where 用户表号 = 1  and  用户户号 = 1 ) 
        as d 
      on C.表号 = D.用户表号 and c.户号 = d.用户户号 
        ) 
    as  A inner join 
    yhlx 
    on A.用户类型 = yhlx.用户类型 
      

  5.   

    非常感谢,CHINABOYZYQ,你的答案是对的。在ACCESS的查询窗体中运行时提示 “A.用户类型 = yhlx.用户类型 处提示"该特定字特A.用户类型可参照多个字段”而后,改成A.C.用户类型 = yhlx.用户类型 后就可以了。 现在的问题就是,您为什么要这样改呢。有什么资料有详细的规定吗?谢谢。
      

  6.   

    谢谢,jhone99。但是你的代码运行不通过。提示  “FROM子句语法错误” ,好象跟原先的错误一样。
      

  7.   

    6 楼错了,修改一下
    select * from 
       (
       select * from 
          (select * from yhxx where 表号 = 1  and  户号 = 1) as c 
           inner join 
          (select * from sdjl where 用户表号 = 1  and  用户户号 = 1 ) as d 
           on C.表号 = D.用户表号 and c.户号 = d.用户户号 
        ) 
    as  A inner join 
    yhlx 
    on A.用户类型 = yhlx.用户类型