Subqueries are not allowed in this context. Only scalar expressions are allowed.
我想获取表中某一列的最大值,然后插入到另外一个表中,报错的Sql如下:insertintoAA(AA_ID,AA_YWFSRQ)
values
(NewID(),(SELECTCONVERT(varchar,DATEADD(day,-1,CAST(SUBSTRING(MAX(YEB_RQ),1,4)
+SUBSTRING(MAX(YEB_RQ),5,2)+SUBSTRING(MAX(YEB_RQ)