gpt4 book ai didi

sql - 具有多个联接的SQL JOIN语法错误

转载 作者:行者123 更新时间:2023-12-03 08:15:01 25 4
gpt4 key购买 nike

SELECT
*
FROM
[SQL].[dbo].[Debtors] d
JOIN
[SQL].[dbo].[DebtorIndex] di
JOIN
[SQL].[dbo].[DebtorAddresses] da ON d.IDNumber = di.IDNumber
AND d.AutoNumber = da.DebtorID
AND da.DebtorID = '199'

我收到此错误

Msg 102, Level 15, State 1, Line 3
Incorrect syntax near 'da'.



首先,这里没有任何东西。那里还有其他东西吗?

其次是 [SQL].[dbo].[Debtors] d,我知道一个事实,并三重检查 d.IDNumberd.AutoNumber是否存在,但是我都收到以下错误

"The multi-part identifier "d.IDNumber" could not be bound."



并为 d.AutoNumber获得相同的结果。

请帮忙。提前致谢

最佳答案

像这样尝试:

SELECT *
FROM [SQL].[dbo].[Debtors] d
INNER JOIN [SQL].[dbo].[DebtorIndex] di ON d.IDNumber = di.IDNumber
INNER JOIN [SQL].[dbo].[DebtorAddresses] da ON d.AutoNumber = da.DebtorID
WHERE da.DebtorID = '199'

关于sql - 具有多个联接的SQL JOIN语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46986416/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com