常用sql 函数练习示例

select ascii('U')

select char(85)

select str(44.4545545)

select lower('ASDFSDAdfsdfsd')

select upper('ASDFSDAdfsdfsd')

select ltrim(' sdfsdf  ')

select rtrim(' sdfsdf       ')

select left('fdsafsfhlkjhkhsdaf',3)

select right('fdsafsfhlkjhkhsdaf',3)

select substring('fdsafsfhlkjhkhsdaf',3,5)

select quotename('dfsdafsdafkjanhomljkljoepwrqwr','<')

select quotename('dfsdafsdafkjanhomljkljoepwrqwr','>')

select quotename('dfsdafsdafkjanhomljkljoepwrqwr','<>')

select quotename('dfsdafsdafkjanhomljkljoepwrqwr','><')

select quotename('dfsdafsdafkjanhomljkljoepwrqwr','(')

select quotename('dfsdafsdafkjanhomljkljoepwrqwr','{')

select quotename('dfsdafsdafkjanhomljkljoepwrqwr','[')

select quotename('dfsdafsdafkjanhomljkljoepwrqwr')

select quotename('dfsdafsdafkjanhomljkljoepwrqwr','<li')

select quotename('dfsdafsdafkjanhomljkljoepwrqwr','"')

select replicate('janhom',10)

select reverse('janhom')

select replace('janhon','n','m')

select space(8)

select stuff('janhom',4,3,'hong')

select stuff('janhom',4,3,'hn')

原文地址:https://www.cnblogs.com/johan/p/1947986.html