我被困在这个地方。我正在尝试在变量中获取单个行集值。
DECLARE @last_timestamp as varchar;
SET @last_timestamp = SELECT MAX(modify_timestamp) FROM dbo.table1
PRINT @last_timestamp
它返回以下错误
Msg 156, Level 15, State 1, Line 2
Incorrect syntax near the keyword 'SELECT'.
Cursor 是解决此问题的唯一方法吗?任何帮助会有帮助吗?