UPDATE [APL4_WATERPLANT].[dbo].[PRINT_PWD]
SET [APL4_WATERPLANT].[dbo].[PRINT_PWD].[CLT_2101] = ([APL4_WATERPLANT].[dbo].[PWD].[CLT_2101]
FROM [APL4_WATERPLANT].[dbo].[PWD]
WHERE [APL4_WATERPLANT].[dbo].[PWD].[DATEANDTIME] = '2013-8-13 12:00:00.000')
每当我尝试执行此代码时,都会收到错误消息。可能是什么问题?
答案 0 :(得分:1)
我认为子查询中缺少select: -
UPDATE [APL4_WATERPLANT].[dbo].[PRINT_PWD]
SET [APL4_WATERPLANT].[dbo].[PRINT_PWD].[CLT_2101] =
(
select [APL4_WATERPLANT].[dbo].[PWD].[CLT_2101]
FROM [APL4_WATERPLANT].[dbo].[PWD]
WHERE [APL4_WATERPLANT].[dbo].[PWD].[DATEANDTIME] = '2013-8-13 12:00:00.000'
)
答案 1 :(得分:1)
试试这个
UPDATE [APL4_WATERPLANT].[dbo].[PRINT_PWD]
SET [APL4_WATERPLANT].[dbo].[PRINT_PWD].[CLT_2101] = (select CLT_2101
FROM [APL4_WATERPLANT].[dbo].[PWD]
WHERE DATEANDTIME = '2013-8-13 12:00:00.000')