"Join expression not supported" 用于 MS Access 中的多个 Left Join
"Join expression not supported" for multiple Left Join in MS Access
我有以下查询,我在我的 ASP.NET 项目中将其作为字符串传递:
SELECT creditorName, amount, interestRate, interestType, interestCalculationMethod, insertedDate, o.fullName AS owner, u.fullName AS dataInsertedBy FROM ((tbl_savings s) LEFT JOIN tbl_users o ON (ownerID = o.userID)) LEFT JOIN tbl_users u ON (dataEnteredByID = u.userID);
为此我收到以下错误:
+ $exception {"Join expression not supported."} System.Data.OleDb.OleDbException
我正在使用 MS Access 2016 作为数据库。
怎么了?
我在 MSDN 上找到了解决方案。这是 link:
对于没有将正确答案与我发布的 link 一起输入,我深表歉意。正确答案如下:
select savingsID, creditorName, amount, interestRate,
interestType, interestCalculationMethod, insertedDate,
ownerID, o.fullName as owner,
u.fullName as dataEnteredBy
from (
(tbl_savings as s)
left join tbl_users as o on s.ownerID = o.userID
) left join tbl_users as u on s.dataEnteredByID = u.userID
我有以下查询,我在我的 ASP.NET 项目中将其作为字符串传递:
SELECT creditorName, amount, interestRate, interestType, interestCalculationMethod, insertedDate, o.fullName AS owner, u.fullName AS dataInsertedBy FROM ((tbl_savings s) LEFT JOIN tbl_users o ON (ownerID = o.userID)) LEFT JOIN tbl_users u ON (dataEnteredByID = u.userID);
为此我收到以下错误:
+ $exception {"Join expression not supported."} System.Data.OleDb.OleDbException
我正在使用 MS Access 2016 作为数据库。
怎么了?
我在 MSDN 上找到了解决方案。这是 link:
对于没有将正确答案与我发布的 link 一起输入,我深表歉意。正确答案如下:
select savingsID, creditorName, amount, interestRate,
interestType, interestCalculationMethod, insertedDate,
ownerID, o.fullName as owner,
u.fullName as dataEnteredBy
from (
(tbl_savings as s)
left join tbl_users as o on s.ownerID = o.userID
) left join tbl_users as u on s.dataEnteredByID = u.userID