--字符串功能 --substring print?substring('iamagoodperson',1,0)">5) select?5)
--upper upper('he?is?a?good?person')
--lower LOWER('this?is?an?VERY?interesting?job')
--ltrim ltrim('?????i?am?a?good?person')
--rtrim rtrim('????heihei,i?do?not?know?why?it?likes?this????????????')
--replace replace('iwanttoaskyou','ttoa',0)">'i?love?you')
--stuff stuff('我的名字是朱旭杰',0)">6,0)">8,0)">'summer')
--Date/Time?Fuction --getdate() getdate()?as?'today'
--dateadd() dateadd(yy,0)">10,255)">getdate())?
--datediff() datediff(yy,0)">'1982/5/3',255)">getdate())?as?
--datepart() datepart(dw,255)">getdate()) datepart(yy,255)">datepart(mm,255)">datepart(dd,255)">datepart(ss,255)">datepart(ms,0)">'1982/5/3') '1982/8/22')
--day(),相当于datepart(dd,128)">时间) day(getdate()) ? --month(),128)">datepart(mm,255)">month(getdate())
--year(),128)">datepart(yy,255)">year(数学函数
--abs() abs(-100.3456)
--sin() sin(0.54)
--cos() cos(3.14)
--power() power(2)
--round?返回数字表达式并四舍五入为指定的长度或精度
round(100.45,0)">1) 123,0)">45,128)">--floor()? floor(4.9) 123.99)
--ceiling() ceiling(--sqrt() sqrt(100)
--square square(10) 15)
转换函数 --cast() cast(100.45?as?int) 1345?varchar(10))
--convert() convert(int,0)">100.56) 10),0)">2345)
空值函数 --isnull() declare?@temp_table?table ( bookID?VARCHAR(10)?primary?key, book_price?float?default?null, bookName?50) ) insert?into?values('1',0)">50,0)">'c#') '2',null?,0)">'c') select?bookID?AS?书的编号isnull(book_price,0)">0)?书的价格'? from?@temp_table
--nullif(),128)">只要参数里的两个表达式相同就返回null nullif('iam',0)">'iam')
--coalesce返回其参数中第一个非空表达式 coalesce('i?am?a?good?boy')
(编辑:李大同)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|