我有这个基本咨询是 sql,但在管理工作室中给了我这个错误:
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.