统计前10000行字符数:
select sum(a.字符数) as X000_input_AmountList平均字符数 from
(SELECT top 10000
(case when ExceptMedica is null then 0 else datalength(ExceptMedica) end)
+(case when ExceptMedicaAmount is null then 0 else datalength(ExceptMedicaAmount) end)
+(case when MedicareAmount is null then 0 else datalength(MedicareAmount) end)
+(case when MedicareDepict is null then 0 else datalength(MedicareDepict) end)
+(case when MedicaSelf is null then 0 else datalength(MedicaSelf) end)
+(case when MedicaSelfAmount is null then 0 else datalength(MedicaSelfAmount) end)
as 字符数
FROM X000_input_AmountList) a
重点是datalength 的应用,这个方法可以统计汉字的长度