1
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')

每当我尝试执行此代码时,我都会收到一条错误消息。可能是什么问题呢 ?

4

2 回答 2

1

我认为子查询中缺少选择:-

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'
          )
于 2013-08-30T07:00:51.327 回答
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')
于 2013-08-30T07:03:33.660 回答