正在看的db2教程是:db2常用傻瓜问题1000问(六)。 149.atan2()
返回用弧度表示的角度的x和y坐标的反正切值.
selectatan2(0.5,0.9)frombsempms;
150.bigint()
返回整型常量中的数字或字符串的64位整数表示.
selectbigint(emp_no)frombsempms;
151.ceiling()orceil()
返回比参数大或等于参数的最小的整数值.
selectceiling(3.56)frombsempms;
selectceil(4.67)frombsempms;
152.char()
返回日期时间型,字符串,整数,十进制或双精度浮点数的字符串表示.
selectchar(salary,',')frombsempms;
153.chr()
返回具有由参数指定的ascii码的字符.
selectchar(167)frombsempms;
154.concat()
返回两个字符串的连接.
selectconcat(emp_no,emp_nam)frombsempms;
155.year()
返回数值的年部分.
selectyear('2003/01/02')frombsempms;
156.varchar()
返回字符串,日期型,图形串的可变长度的字符串表示.
selectvarchar(emp_nam,50)frombsempms;
157.ucase()orupper()
返回字符串的大写.
selectucase(emp_nam)frombsempms;
selectupper(emp_no)frombsempms;
158.truncate()ortrunc()
从表达式小数点右边的位置开始截断并返回该数值.
selecttruncate(345.6789,2)frombsempms;
159.time()
返回一个数值中的时间.
selecttime('2001-03-19.12.30.123456')frombsempms;
160.substr(exp1,exp2)
返回exp1串自exp2处开始的子串.
selectsubstr('cdnjfdjfjd',5)frombsempms;
selectsubstr('cdnjfdjfjd',5,2)frombsempms;
161.sqrt()
返回该参数的平方根.
selectsqrt(36)frombsempms;
162.space()
返回由参数指定的长度,包含空格在内的字符串.
selectspace(10)frombsempms;
163.second()
返回一个数值的秒部分.
selectsecond('18:34:32')frombsempms;
164.rtrim()
删除字符串尾部的空格.
selectrtrim('comment')frombsempms;
165.round(exp1,exp2)
返回exp1小数点右边的第exp2位置处开始的四舍五入值.
selectround(2345.6789,2)frombsempms;
166.replace(exp1,exp2,exp3)
用exp3替代exp1中所有的exp2
selectchar(replace('romandd','ndd','ccb'),10)frombsempms;
167.repeat(exp1,exp2)
返回exp1重复exp2次后的字符串.
selectchar(repeat('repeat',3),21)frombsempms;
168.real()
返回一个数值的单精度浮点数表示.
selectreal(10)frombsempms;
169.rand()
返回0和1之间的随机浮点数.
selectrand()frombsempms;
170.power(exp1,exp2)
返回exp1的exp2次幂.
selectpower(2,5)frombsempms;
171.posstr(exp1,exp2)
返回exp2在exp1中的位置.
select('abcdefgh','d')frombsempms;
172.nullif(exp1,exp2)
如果exp1=exp2,则为null,否则为exp1
173.nodenumber()
返回行的分区号.
selectnodenumber(emp_no)frombsempms;
174.month()
返回一个数值的月部分.
selectmonth('2003/10/20')frombsempms;
175.mod(exp1,exp2)
返回exp1除以exp2的余数.
selectmod(20,8)frombsempms;
176.minute()
返回一个数值的分钟部分.
selectminute('18:34:23')frombsempms;
177.ltrim()
删除字符串前面的空格.
selectltrim('cddd')frombsempms;
178.hour()
返回一个数值的小时部分.
selecthour('18:34:23')frombsempms;
179.double()
如果参数是一个数字表达式,返回与其相对应的浮点数,如果参数是字符串表达式,则返回该数的字符串表达式.
selectdouble('5678')frombsempms;
180.exp()
返回参数的指数函数.
selectexp(2)frombsempms;
181.float()
返回一个数的浮点表示.
selectfloat(789)frombsempms;
182.floor()
返回小于或等于参数的最大整数.
selectfloor(88.93)frombsempms;
183.hex()
返回一个表示为字符串的值的16进制表示.
selecthex(16)frombsempms;
发表评论