Sql 計算一個詞出現的次數
create table w
(
word nvarchar(100)
)
insert into w(word)
select('去')
union all
select('第三方')
union all
select(',')
union all
select('士大夫')
union all
select('girls')
union all
select(' <:')
declare @t nvarchar(1000)
set @t='我們今天要去的地方要和第三方枯葉,頂替頂替去要奪枯地枯需要地 <.'
select word,(len(@t)-len(replace(@t,word,'')))/len(word)
from w
where @t like '%'+word+'%'

浙公網安備 33010602011771號