ylbtech-SQL Server-Function:f_GetPy
 
A, 返回顶部
1、f_GetPy
Create function   [dbo].[f_GetPy](@str   nvarchar(4000))
returns nvarchar(4000)
as
begin
declare @strlen int,@re nvarchar(4000)
declare @t table(chr nchar(1) collate Chinese_PRC_CI_AS,letter nchar(1))
insert into @t(chr,letter)
select '吖 ', 'A ' union all select '八 ', 'B ' union all
select '嚓 ', 'C ' union all select '咑 ', 'D ' union all
select '妸 ', 'E ' union all select '发 ', 'F ' union all
select '旮 ', 'G ' union all select '铪 ', 'H ' union all
select '丌 ', 'J ' union all select '咔 ', 'K ' union all
select '垃 ', 'L ' union all select '嘸 ', 'M ' union all
select '拏 ', 'N ' union all select '噢 ', 'O ' union all
select '妑 ', 'P ' union all select '七 ', 'Q ' union all
select '呥 ', 'R ' union all select '仨 ', 'S ' union all
select '他 ', 'T ' union all select '屲 ', 'W ' union all
select '夕 ', 'X ' union all select '丫 ', 'Y ' union all
select '帀 ', 'Z '
select @strlen=len(@str),@re= ' '
while @strlen> 0
begin
select top 1 @re=letter+@re,@strlen=@strlen-1
from @t a where chr <=substring(@str,@strlen,1)
order by chr desc
if @@rowcount=0
select @re=substring(@str,@strlen,1)+@re,@strlen=@strlen-1
end
return(@re)
end
2、
B,返回顶部
 
C,返回顶部
 
D,返回顶部
 
作者:ylbtech
出处:http://storebook.cnblogs.com/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

DBS-Function:f_GetPy的更多相关文章

  1. Function:光标位置插入文本并且光标移动到最后

    //光标位置插入文本 function insertText(obj, str) { if(document.selection) { var sel = document.selection.cre ...

  2. Oracle Function:TO_CHAR

    Description The Oracle/PLSQL TO_CHAR function converts a number or date to a string.将数字转换为日期或字符串 Syn ...

  3. Oracle Function:COUNT

    Description The Oracle/PLSQL COUNT function returns the count of an expression. The COUNT(*) functio ...

  4. Oracle Function: NVL

    Description The Oracle/PLSQL NVL function lets you substitute a value when a null value is encounter ...

  5. [ES6系列-02]Arrow Function:Whats this?(箭头函数及它的this及其它)

    [原创] 码路工人 大家好,这里是码路工人有力量,我是码路工人,你们是力量. 如果没用过CSharp的lambda 表达式,也没有了解过ES6,那第一眼看到这样代码什么感觉? /* eg.0 * fu ...

  6. Function:html结构转字符串形式显示

    //Html结构转字符串形式显示 支持<br>换行 function ToHtmlString(htmlStr) { return toTXT(htmlStr).replace(/\&am ...

  7. Oracle之:Function :strFormatDate()

    create or replace function strFormatDate(i_datestr in varchar2) return date is begin if i_datestr is ...

  8. Oracle之:Function :func_float()

    create or replace function func_float(i_value float) return number is v_index number := 0; v_str var ...

  9. Oracle之:Function :numberToDate()

    create or replace function numberToDate(i_date in number) return date is v_date number; result date ...

随机推荐

  1. nethogs命令执行报异常的解决方法

  2. yii2上传七牛图片(超详细)

    前期准备 1.在七牛注册账号https://portal.qiniu.com/signup/choice 2.创建空间https://portal.qiniu.com/bucket(记住存储空间名称和 ...

  3. Archive for required library: 'E:/repository/org/apache/ant/ant/1.7.1/ant-1.7.1.jar' in project 'test02' cannot be read or is not a valid ZIP file

    Archive for required library: 'E:/repository/org/apache/ant/ant/1.7.1/ant-1.7.1.jar' in project 'tes ...

  4. fastadmin默认的controller已实现的方法

    fastadmin控制器 <?php namespace app\admin\controller\peizi; use app\common\controller\Backend; /** * ...

  5. Create-react-app+Antd-mobile+Less配置(学习中的记录)

    (参考别人结合自己的整理得出,若有错误请大神指出) Facebook 官方推出Create-React-App脚手架,基本可以零配置搭建基于webpack的React开发环境,内置了热更新等功能. 详 ...

  6. Codeforces 208A-Dubstep(字符串)

    Vasya works as a DJ in the best Berland nightclub, and he often uses dubstep music in his performanc ...

  7. Java笔记(十五) 并发包

    并发包 Java中还有一套并发工具包,位于包java.util.concurrent下,里面包括很多易用 且很多高性能的并发开发工具. 一.原子变量和CAS 为什么需要原子变量,因为对于例如count ...

  8. 杭店 ACM 1864 最大报销额 01背包

    ![勾选C++才能过 题意: 先规定可以报销一定额度的发票,物品类型有A,B,C,三种.要求每张发票总额不得超过1000元,单项物品不得超过600.求报销的最大额 分析: 先找到合格的发票,然后再挑选 ...

  9. 最近在学习python,做了一道人机大战的题目,分享一下,虽然可能有些麻烦,但是每个人思维是不同的。

    #题目如下:1:人和机器进行猜拳游戏写成一个类,首先选择角色:1 曹操 2张飞 3 刘备,然后选择的角色进行猜拳:1剪刀 2石头 3布 玩家输入一个1-3的数字 : 1 import random c ...

  10. No compiler is provided in this environment.Perhaps you are running on a JRE rather than a JDK?报错解决

    Maven install 时出现如上错误. Eclipse-->Window-->preferences-->Java-->Installed JREs 查看jdk: 发现此 ...