sqlServer分别求(1)每个字笔画数都相同的成语,(2)每个字都含有偏旁三点水或火字旁的成语

7057℃ TIFFANY

sqlServer分别求(1)每个字笔画数都相同的成语,(2)每个字都含有偏旁三点水或火字旁的成语

谁给我来一个得到sql函数,要求能统计汉字笔画数?

  --===============================================

  --功能:汉字笔画函数

  --说明:以单个汉字汉字为参数返回每一个汉字的笔画数

  --===============================================

  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'马' unionall select 4,N'风'

  union all select 5,N'龙' unionall select 6,N'齐'

  union all select 7,N'龟' unionall select 8,N'齿'

  union all select 9,N'鸩' unionall 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

  */

每个字都是三点水旁的词语

清澈、波涛、江湖、澎湃、湖泊、清洁、洗涤、渤海、流浪、灌溉、渡河

写出词语的两个字都有相同的偏旁,偏旁是单人旁,不少于3个

伶仃 伶俐 仿佛 俯仰 你们 他们

有疑问,请追问。

懂了,就采纳好评吧~~

那些成语的所有字都是同一个偏旁,比如“汹涌澎湃”都是三点水的偏旁,还有“魑魅魍魉”都是鬼字旁的偏旁

波涛汹涌 魑魅魍魉 惺惺惜惺惺 抽抽搭搭 泾浊渭清 汹涌澎湃 源叽叽喳喳 唠唠叨叨 嘻嘻哈哈

TAG: 成语 偏旁