gpt4 book ai didi

c# - SQL Server 2008 选择在

转载 作者:太空宇宙 更新时间:2023-11-03 20:13:47 24 4
gpt4 key购买 nike

我的基本咨询是 sql,但在 management studio 中给我这个错误:

SELECT * 
FROM [Oficios_dev2].[dbo].[doc].[typecdocumentdet] as [C]
where [C].[TypeCDocument] in (select [Oficios_dev2].[dbo].[doc].[TypeCDocument] as [D]
where [D].[Id] = '1')

错误

Msg 4104, Level 16, State 1, Line 3
The multi-part identifier "D.Id" could not be bound.
Msg 4104, Level 16, State 1, Line 3
The multi-part identifier "Oficios_dev2.dbo.doc.TypeCDocument" could not be bound.

我不知道为什么,任何人?谢谢

编辑:新查询:

SELECT *
FROM [Oficios_dev2].[dbo].[doc] as [C] where [C].[TypeCDocument] in (select [Oficios_dev2].[dbo].[doc] from [Oficios_dev2].[dbo].[doc] as [D] where [D].[Id] = '1')

这仍然减少了我的错误 1 ​​

The multi-part identifier "Oficios_dev2.dbo.doc" could not be bound.

最佳答案

内部查询格式不正确:

你有:

(select [Oficios_dev2].[dbo].[doc].[TypeCDocument] as [D] where [D].[Id] = '1')

应该是这样的:

(select TypeCDocument FROM [Oficios_dev2].[dbo].[doc] as [D] where [D].[Id] = '1')

关于c# - SQL Server 2008 选择在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18237523/

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