Access中的Inner join left join right join 嵌套连接查询语法

visibility 801 access_time 9 years ago language中文

和SQLServer 的不一样,注意其中的括号

SELECT fields
(table2 INNER JOIN [( ]table3
[INNER JOIN [( ]tablex [INNER JOIN ...)]
ON table3.field3 compopr tablex.fieldx)]
ON table2.field2 compopr table3.field3)
ON table1.field1 compopr table2.field2;


语法错误 (操作符丢失) 在查询表达式 'ur.UserID=u.UserID inner join [DT_Role] r on r.RoleID=ur.RoleID' 中。 在 .....


Select r.RoleName from [User] u inner join [UserInRoles] ur on u.UserID=ur.UserID inner join [Role] r on ur.RoleID=r.RoleID where u.UserName= ? and ApplicationID is null

这里在SQL Server中是不会出错的,但是在Acceess中则会出错,应该改为

Select r.RoleName from [User] u inner join ([UserInRoles] ur inner join [Role] r on ur.RoleID=r.RoleID)on u.UserID=ur.UserID where u.UserName= ? and ApplicationID is null


info Last modified by Raymond 9 years ago copyright This page is subject to Site terms.

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

timeline Stats
Page index 0.18
More from Kontext
.NET - Transform XML Data with XSLT
visibility 367
thumb_up 1
access_time 9 months ago
Read Embedded Assembly Resource Files in .NET
visibility 1,263
thumb_up 0
access_time 10 months ago
EntityFramework Core - Connect to MySQL
visibility 121
thumb_up 0
access_time 2 years ago