select left(talk_source,LEN(Talk_source)-CHARINDEX('?',REVERSE(Talk_source))) as Talk_source2,* from Zoosnet_Data where Project_ID=1 and (Zoosnet_Visit_Start_Time between '2013-1-1' and '2013-8-1') and Zoosnet_Data.Talk_Source like '%http://www.baidu.com/abc.html?eee%'
[解决办法] 你写的sql好像只能处理问号, 处理#,/可以这样写: select replace(replace(left(talk_source, patindex('%[?#]%', talk_source+'?')-1)+'$$','/$$',''),'$$','') as Talk_source2,* from Zoosnet_Data where Project_ID=1 and (Zoosnet_Visit_Start_Time between '2013-1-1' and '2013-8-1') and Zoosnet_Data.Talk_Source like 'http://www.baidu.com/abc.html?eee%'