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. Codeforces 865C Gotta Go Fast 二分 + 期望dp (看题解)

    第一次看到这种骚东西, 期望还能二分的啊??? 因为存在重置的操作, 所以我们再dp的过程中有环存在. 为了消除环的影响, 我们二分dp[ 0 ][ 0 ]的值, 与通过dp得出的dp[ 0 ][ 0 ...

  2. Android测试环境搭建

    Android测试环境搭建 一.操作系统 使用Win7_64位操作系统.(可以用其他的系统,下面都是针对Win7 64位进行操作) 二.安装JDK 运行jdk-6u45-windows-x64.exe ...

  3. P1135 奇怪的电梯 dp

    题目描述 呵呵,有一天我做了一个梦,梦见了一种很奇怪的电梯.大楼的每一层楼都可以停电梯,而且第ii层楼(1 \le i \le N)(1≤i≤N)上有一个数字K_i(0 \le K_i \le N)K ...

  4. P1433 吃奶酪 回溯法 优化

    题目描述 房间里放着n块奶酪.一只小老鼠要把它们都吃掉,问至少要跑多少距离?老鼠一开始在(0,0)点处. 输入输出格式 输入格式: 第一行一个数n (n<=15) 接下来每行2个实数,表示第i块 ...

  5. 011 Linux环境下配置eclipse,以及创建maven工程

    一:maven的安装 1.安装配置maven环境变量 2.验证 二:eclipse的安装 3.解压配置eclipse 4.启动eclipse,必须在虚拟机的eclipse下启动 5.结果 三:修改配置 ...

  6. Linux下的Mysql数据库备份+还原

    数据库备份: root@debian-mm:/home/debian-mm# mysqldump -u root -p Account > Account.sql Enter password: ...

  7. TF:TF分类问题之MNIST手写50000数据集实现87.4%准确率识别:SGD法+softmax法+cross_entropy法—Jason niu

    import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data # number 1 to 10 ...

  8. 正确实现用spring扫描自定义的annotation

    背景在使用spring时,有时候有会有一些自定义annotation的需求,比如一些Listener的回调函数. 比如: @Service public class MyService { @MyLi ...

  9. XamarinAndroid组件教程RecylerView动画组件使用动画(3)

    XamarinAndroid组件教程RecylerView动画组件使用动画(3) (8)打开Main.axml文件,构建主界面.代码如下: <?xml version="1.0&quo ...

  10. SpringIOC和DI

    1.Spring的概念 Spring的绿草丛(一) Spring轻量级框架, Java EE的春天,当前主流框架目标使现有技术更加易用,推进编码最佳实践内容IoC容器AOP实现数据访问支持简化JDBC ...