如何整体去除 横杠以后的字符,如 2998-aa 修正为 2998,谢谢 如何整体去除 横杠以后的字符,如 2998-aa 修正为 2998,谢谢---------------------------------几万条记录,要处理,求最精简的代码 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 update tb set col=left(col,charindex('-',col)) 如果没有-,那以前的就over了。 update tb set col=left(col,charindex('-',col)) where charindex('-',col)>0 考虑的对update tb set col=case charindex('-',col)!=0 then substring(col,1,charindex('-',col)) end update tb set col1=case when charindex('-',col1)>0 then substring(col1,1,charindex('-',col1)-1) else col1 end楼上的貌似都忘了减1 sql 2005 问题 问个sql语句 一个很简单的交叉表的问题(在线等) 请帮助完成下面的fuction 急!请教BCP导文本文件入库的问题 如何将一个字段的多个记录值合在一行显示?? SQL Server Profiler中碰到的一个疑难问题 求一SQL语句 关于sql2000中链接服务器(Linker)的创建问题,高手请进 按志愿求报名总人数 虚拟主机商提供的数据库空间没有作业功能怎么办? 问一下,c++连接mssql的最佳方式是什么?
update tb set col=case charindex('-',col)!=0 then substring(col,1,charindex('-',col)) end
update tb set col1=case when charindex('-',col1)>0 then substring(col1,1,charindex('-',col1)-1) else col1 end楼上的貌似都忘了减1