zoukankan      html  css  js  c++  java
  • SQL拼音

    /****** 对象:  UserDefinedFunction [dbo].[HZ2PY]    脚本日期: 05/02/2012 18:23:38 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    drop function getpy
    go
    --汉字转换拼音函数
    create Function [dbo].[getpy](     @cString nVarChar (200)) Returns nVarChar(100)
    AS
    Begin
        Declare @nFor    Int      --字符串循环用
        Declare @nPYFor  Int      --拼音串循环用
        Declare @cPYString  VarChar(100)     --拼音串
        Declare @cCurChar VarChar(2)         --当前字符 
        Declare @vReturn VarChar (100)      ----将返回的结果
        Set @cPYString = '吖八嚓咑妸发旮铪讥讥咔垃呣拿讴趴七呥仨他哇哇哇夕丫匝咗'
        Set @vReturn = '' 
        Set @nFor = 0 
        While @nFor < Len(@cString)  
        Begin  
            Set @nFor = @nFor + 1  
            Set @cCurChar = Substring(@cString,@nFor,1)  
            Set @nPYFor = 0  
            While @nPYFor < len(@cPYString)     
            Begin     
                Set @nPYFor = @nPYFor + 1 
                If @cCurChar < Substring(@cPYString,@nPYFor,1)  
                    Begin        
                        Set @vReturn = Rtrim(@vReturn) + (Case When @nPYFor <> 1 Then Char(63 + @nPYFor) Else @cCurChar End)  
                        Break       
                    End    
                Else    
                    Begin  
                        Continue
                    End    
            End   
        End
        Return @vReturn
    END
  • 相关阅读:
    nginx能访问html静态文件但无法访问php文件
    LeetCode "498. Diagonal Traverse"
    LeetCode "Teemo Attacking"
    LeetCode "501. Find Mode in Binary Search Tree"
    LeetCode "483. Smallest Good Base" !!
    LeetCode "467. Unique Substrings in Wraparound String" !!
    LeetCode "437. Path Sum III"
    LeetCode "454. 4Sum II"
    LeetCode "445. Add Two Numbers II"
    LeetCode "486. Predict the Winner" !!
  • 原文地址:https://www.cnblogs.com/hhq80/p/2508874.html
Copyright © 2011-2022 走看看