这是之前的效果 sql 语句:select leixing FROM xhcx2 where leixing is not null order by leixing ![]() 之后的结果: SELECT distinct SUBSTRING(leixing,1,(case when CHARINDEX(',',leixing)>0 then CHARINDEX(',',leixing) else DATALENGTH(xhcx2.leixing) end)-1 ) as leixing FROM xhcx2 where leixing is not null order by leixing GO ![]() |
|