DB2基礎問答系列四(1)

來源:互聯網
上載者:User

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;


相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.