高手请进,这个SQL语句太难了? Select 年份,轮,序号,主客队,主队=SubString(主客队,1,CharIndex('VS',主客队)), 客队=Right(主客队,CharIndex('VS',主客队),Len(主客队)) from 表 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Select 年份,轮,序号,主客队,主队=SubString(主客队,1,CharIndex('VS',主客队)-1), 客队=Right(主客队,CharIndex('VS',主客队)+2,Len(主客队)) from 表 Update Table Set 主队 = left(主客队,charindex('VS',主客队)-1),客队 = right(主客队,len(主客队)-charindex('VS',主客队)-1) update 表 set 主队=left(主客队,charindex('VS',主客队)-1) ,客队=substring(主客队,charindex('VS',主客队)+2,len(主客队)) update 表 set 主队=left(主客队,charindex('VS',主客队)-1) ,客队=replace(主客队,left(主客队,charindex('VS',主客队)-1)+'VS','') update 表 set 主队=left(主客队,charindex('VS',主客队)-1) ,客队=substring(主客队,charindex('VS',主客队)+2,8000) Select 年份,轮,序号, 主客队, 主队=SubString(主客队,1,CharIndex('VS',主客队)-1), 客队=substring(主客队,CharIndex('VS',主客队)+2,Len(主客队))from 表 反正就是这几个函数,自己琢磨最好CharIndex; Left;Right;SubString,Len,Replace 大家的方法都不错!没一种方法我都测试了.97866(weiLuang)的select语句中的RIGHT应该为SUBSTRING.谢谢大家!!!!! 求教一个语法问题啊? SQL2005环境,存储过程需要跨数据库更新,目前使用LinkServer,经过测试效率不高,有没有别的更高效率的实现方式? 为表+一个约束~~ 如何将文件导入到image字段中? 我想建立一个这样的SQL查询: 这个trigger怎么做? sql_server_2000_恢复 插入问题 安装SQLSERVER 2000时遇到的怪问题,急 先来先得分。请问这个语句有什么错误。谢谢了。 关于表的设计--象chinaren.com中班级管理员有批准的能力 急!在线等待!sql语句问题
客队=Right(主客队,CharIndex('VS',主客队)+2,Len(主客队))
from 表
客队 = right(主客队,len(主客队)-charindex('VS',主客队)-1)
,客队=substring(主客队,charindex('VS',主客队)+2,len(主客队))
update 表 set 主队=left(主客队,charindex('VS',主客队)-1)
,客队=replace(主客队,left(主客队,charindex('VS',主客队)-1)+'VS','')
,客队=substring(主客队,charindex('VS',主客队)+2,8000)
年份,轮,序号,
主客队,
主队=SubString(主客队,1,CharIndex('VS',主客队)-1),
客队=substring(主客队,CharIndex('VS',主客队)+2,Len(主客队))
from 表
CharIndex; Left;Right;SubString,Len,Replace
97866(weiLuang)的select语句中的RIGHT应该为SUBSTRING.
谢谢大家!!!!!