出错

My_first My_first 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
set @sql = 'declare cur_id cursor for select max('+'dh'+') from mxsb where convert(char(10),mdate,120)='''+@Mydate+''''
exec(@sql)
Open cur_id
fetch next from cur_id into @Maxid


改为下面的就出错
set @sql = 'declare cur_id cursor for select max('+'dh'+') from mxsb where substring(dh,12,4) as char)='+@userbh+'convert(char(10),mdate,120)='''+@Mydate+''''
exec(@sql)
Open cur_id

我加了一句substring(dh,12,4) as char)='+@userbh+'
...全文
评论 7
收藏 已收藏
分享
返回顶部
My_first
MS-SQL Server 34,876 成员 254,635 内容