下面这个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.用户类型 )
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.用户类型 )
把上面这个SQL语句的AS A去掉就可以正常执行,如果带AS A 的话,如何能保证这个SQL语句的正常执行呢。
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.用户类型,...来出库。
(
(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.用户类型
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.用户类型