一列name
Tritton AX 180: Universal Gaming Headset (PS3/Xbox 360/PC/Mac)
Rome: Total War - White Label (PC DVD)
Railworks3 - Train Simulator 2012 (PC)
我想得到:
Tritton AX 180: Universal Gaming Headset
Rome: Total War - White Label
Railworks3 - Train Simulator 2012
我调查了replace()
答案 0 :(得分:1)
DECLARE @s VARCHAR(100) =
'Tritton AX 180: Universal Gaming Headset (PS3/Xbox 360/PC/Mac)'
SELECT SUBSTRING(@s, 0, CHARINDEX('(',@s))
因此,如果您的列名称为name
,那么
SELECT SUBSTRING(name, 0, CHARINDEX('(',name) )