zoukankan      html  css  js  c++  java
  • 得到汉字笔画函数

    --===============================================
    --功能:汉字笔画函数
    --说明:以单个汉字汉字为参数返回每一个汉字的笔画数
    --作者: J9988 --*/
    --===============================================
    create function [dbo].[fun_getbh](@char nchar(2))
    returns int
    as
    begin
    return(
        case when unicode(@char) between 19968 and 40869 then(
            select top 1 id from(
                select id=1,ch=N''      union all select 2,N''
                union all select 3,N''  union all select 4,N''
                union all select 5,N''  union all select 6,N''
                union all select 7,N''  union all select 8,N'齿'
                union all select 9,N''  union all select 10,N''
                union all select 11,N'' union all select 12,N''
                union all select 13,N'' union all select 14,N''
                union all select 15,N'' union all select 16,N''
                union all select 17,N'' union all select 18,N''
                union all select 19,N'' union all select 20,N''
                union all select 21,N'' union all select 22,N''
                union all select 23,N'' union all select 24,N''
                union all select 25,N'' union all select 26,N''
                union all select 27,N'' union all select 28,N''
                union all select 29,N'' union all select 30,N''
                union all select 31,N'' union all select 32,N''
                union all select 33,N'' union all select 35,N''
                union all select 36,N'' union all select 39,N''
                union all select 64,N''
            )a where ch>=@char collate Chinese_PRC_Stroke_CS_AS_KS_WS
            order by id ASC) else 0 end)
    end
     
    --测试示例
    select dbo.fun_getbh('')
     
    --运行结果
    /*
    10
    */
  • 相关阅读:
    动态库 DLL 封装二:dll封装方法
    动态库 DLL 封装一:dll分类
    C++读取配置文件ini
    WCHAR 字符串拼接
    关于web桌面应用的集成解决方案
    CSS Grid网格布局(转)
    使用 antd 的 form 组件来自定义提交的数据格式
    syslogd日志的一些作用
    我的三年感悟——避免无尽的自我内耗
    《被讨厌的勇气》读后感
  • 原文地址:https://www.cnblogs.com/accumulater/p/6244691.html
Copyright © 2011-2022 走看看