比如说 科比-布莱恩特 Kobe Bryant 
他的首字母是Bselect * from table where name = ?怎么在Kobe Bryant 中跳过当中的空格查找出空格后面的姓名首字母B 呢?加油加油加油!!!!!!!!!!

解决方案 »

  1.   

    name=substring('Kobe Bryant',charindex(' ','Kobe Bryant')+1,1)
      

  2.   

    select substring(name , charindex(' ' , name) + 1 , 1) from tb
      

  3.   

    create table tb(name varchar(50))
    insert into tb values('Kobe Bryant')
    insert into tb values('Kobe Aryant')
    goselect substring(name , charindex(' ' , name) + 1 , 1) from tbdrop table tb/*
         
    ---- 
    B
    A(所影响的行数为 2 行)
    */
      

  4.   


    select substring(name , charindex(' ' , name) + 1 , 1) from table感觉问题不是很清楚,倒是是要结果,还是条件?
      

  5.   


    select * from table where substring(name , charindex(' ' , name) + 1 , 1)='B'
    能找出B字母的人名