SQL code:
select A.commandKey,A.enabled,A.commandFile,A.targetControl,A.rightId,A.type,[B].[value] as commandType,A.state,[C].[value] as commandState,A.parent,A.commandText,A.commandTipText,A.icon,A.description
from t_commands as A
inner join t_parameters as B on [A].[type]=[B].[code]
inner join t_parameters as C on [A].[state]=[C].[code]
where B.id=3 and C.id=4
如上SQL,执行的时候就提示“语法错误(操作符丢失)在‘[A].[type]=[B].[code]
inner join t_parameters as C on [A].[state]=[C].[code] ’中”的提示,然后我发现如果把后面的join语句去掉不连接的话就能正常查询出数据,是不是Access不支持多个连接查询的?
select * from (select * from table1 t1 left join table2 t2 on t1.id=t2.id) t left join table3
t3 on t.id=t3.id
只有用LEFT JOIN+RIGHT JOIN
select A.commandKey,A.enabled,A.commandFile,A.targetControl,A.rightId,A.type,.[value] as commandType,A.state,[C].[value] as commandState,A.parent,A.commandText,A.commandTipText,A.icon,A.description
from (t_commands as A
inner join t_parameters as B on [A].[type]=[B].[code] )
inner join t_parameters as C on [A].[state]=[C].[code]
where B.id=3 and C.id=4
[b]加上()
学习中~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~顶起!!!!!!!!!!!!!!!
高手都帮你回答了
我就告诉
可能因为工作的原因 接触数据库这块比较少,之前都是做程序这块,数据库这块都有专门的人来做 分工都很明细 所以对数据库这一块完全不了解。前段时间 去面试了几家公司 几乎都是在数据库这块挂掉的 连个简单的SQ ......