问一个SQL语句的写法,不难.
B/T   10792-1995   象这种值,取-之前的字符怎么写? 
 就是取到   B/T   10792   
 我的表名是TABLE1,这一列字段名是   ttt   
 多谢!
------解决方案--------------------select substring(ttt,1,charindex( '- ',ttt)-1) as ttt 
 from TABLE1
------解决方案--------------------select left(ttt,1,charindex( '- ',ttt)-1) ttt from TABLE1
------解决方案--------------------declare @de varchar(50) 
 select @de =  'B/T 10792-1995 '   
 select left(@de,charindex( '- ',@de)-1)