Select 年份,轮,序号,主客队,主队=SubString(主客队,1,CharIndex('VS',主客队)),
                           客队=Right(主客队,CharIndex('VS',主客队),Len(主客队))
   from 表

解决方案 »

  1.   

    Select 年份,轮,序号,主客队,主队=SubString(主客队,1,CharIndex('VS',主客队)-1),
                               客队=Right(主客队,CharIndex('VS',主客队)+2,Len(主客队))
       from 表
      

  2.   

    Update Table Set 主队 = left(主客队,charindex('VS',主客队)-1),
    客队 = right(主客队,len(主客队)-charindex('VS',主客队)-1)
      

  3.   

    update 表 set 主队=left(主客队,charindex('VS',主客队)-1)
        ,客队=substring(主客队,charindex('VS',主客队)+2,len(主客队))
      

  4.   


    update 表 set 主队=left(主客队,charindex('VS',主客队)-1)
        ,客队=replace(主客队,left(主客队,charindex('VS',主客队)-1)+'VS','')
      

  5.   

    update 表 set 主队=left(主客队,charindex('VS',主客队)-1)
        ,客队=substring(主客队,charindex('VS',主客队)+2,8000)
      

  6.   

    Select 
      年份,轮,序号,
      主客队,
      主队=SubString(主客队,1,CharIndex('VS',主客队)-1),
      客队=substring(主客队,CharIndex('VS',主客队)+2,Len(主客队))
    from 表
      

  7.   

    反正就是这几个函数,自己琢磨最好
    CharIndex; Left;Right;SubString,Len,Replace
      

  8.   

    大家的方法都不错!没一种方法我都测试了.
    97866(weiLuang)的select语句中的RIGHT应该为SUBSTRING.
    谢谢大家!!!!!