DB2 common dummies 1000 questions (6)

Source: Internet
Author: User

The db2 Tutorial we are reading is: DB2 common dummies 1000 (6 ). 149. ATAN2 ()
Returns the arc tangent of the angle X and Y coordinates in radians.
SELECTATAN2 (0.5, 0.9) FROMBSEMPMS;
  
150. BIGINT ()
Returns the 64-bit integer representation of a number or string in an integer constant.
SELECTBIGINT (EMP_NO) FROMBSEMPMS;
  
151. CEILING () ORCEIL ()
Returns the smallest integer value greater than or equal to the parameter.
SELECTCEILING (3.56) FROMBSEMPMS;
SELECTCEIL (4.67) FROMBSEMPMS;
  
152. CHAR ()
Returns the string representation of the datetime type, String, integer, decimal or double-precision floating point number.
SELECTCHAR (SALARY, ',') FROMBSEMPMS;
  
153. CHR ()
Returns the characters with the specified ASCII code.
SELECTCHAR (167) FROMBSEMPMS;
154. CONCAT ()
Returns the connection of two strings.
SELECTCONCAT (EMP_NO, EMP_NAM) FROMBSEMPMS;
  
155. YEAR ()
Returns the year of the value.
SELECTYEAR ('2014/1/02 ') FROMBSEMPMS;
  
156. VARCHAR ()
Returns the string, date type, and variable-length string representation of the graphic string.
SELECTVARCHAR (EMP_NAM, 50) FROMBSEMPMS;
  
157. UCASE () ORUPPER ()
Returns the string in uppercase.
SELECTUCASE (EMP_NAM) FROMBSEMPMS;
SELECTUPPER (EMP_NO) FROMBSEMPMS;

158. TRUNCATE () ORTRUNC ()
This value is truncated from the right of the decimal point in the expression and returned.
SELECTTRUNCATE (345.6789, 2) FROMBSEMPMS;
  
159. TIME ()
Returns the time in a value.
SELECTTIME ('2017-03-19.12.30.123456 ') FROMBSEMPMS;
  
160. SUBSTR (EXP1, EXP2)
Returns the substring of the EXP1 string starting with EXP2.
SELECTSUBSTR ('cdnjfdjfjd ', 5) FROMBSEMPMS;
SELECTSUBSTR ('cdnjfdjfjd ', 5, 2) FROMBSEMPMS;
  
161. SQRT ()
Returns the square root of the parameter.
SELECTSQRT (36) FROMBSEMPMS;
  
162. SPACE ()
Returns a string of the specified length, including spaces.
SELECTSPACE (10) FROMBSEMPMS;
  
163. SECOND ()
Returns the second of a value.
SELECTSECOND ('18: 34: 32') FROMBSEMPMS;
  
164. RTRIM ()
Removes spaces at the end of a string.
SELECTRTRIM ('comment') FROMBSEMPMS;
  
165. ROUND (EXP1, EXP2)
Returns the rounded value starting at the position EXP2 on the right of the EXP1 decimal point.
SELECTROUND (2345.6789, 2) FROMBSEMPMS;
  
166. REPLACE (EXP1, EXP2, EXP3)
Use EXP3 to replace all EXP2 in EXP1
SELECTCHAR (REPLACE ('romandd', 'ndd', 'ccb'), 10) FROMBSEMPMS;
  
167. REPEAT (EXP1, EXP2)
Returns the string that EXP1 repeats EXP2.
SELECTCHAR (REPEAT ('repeat', 3), 21) FROMBSEMPMS;
  
168. REAL ()
Returns the single-precision floating-point representation of a value.
SELECTREAL (10) FROMBSEMPMS;
  
169. RAND ()
Returns a random floating point number between 0 and 1.
SELECTRAND () FROMBSEMPMS;
  
170. POWER (EXP1, EXP2)
Returns the EXP2 power of EXP1.
SELECTPOWER (2, 5) FROMBSEMPMS;
  
171. POSSTR (EXP1, EXP2)
Returns the position of EXP2 in EXP1.
SELECT ('abcdefgh', 'D') FROMBSEMPMS;
  
172. NULLIF (EXP1, EXP2)
If EXP1 = EXP2, It is NULL; otherwise, it is EXP1.
173. NODENUMBER ()
Returns the Partition Number of the row.
SELECTNODENUMBER (EMP_NO) FROMBSEMPMS;
  
174. MONTH ()
Returns the month of a value.
SELECTMONTH ('2014/1/20') FROMBSEMPMS;
  
175. MOD (EXP1, EXP2)
Returns the remainder of EXP1 divided by EXP2.
SELECTMOD (20, 8) FROMBSEMPMS;
  
176. MINUTE ()
Returns the minute of a value.
SELECTMINUTE ('18: 34: 23') FROMBSEMPMS;
  
177. LTRIM ()
Removes spaces before a string.
SELECTLTRIM ('cddd') FROMBSEMPMS;
  
178. HOUR ()
Returns the hour of a value.
SELECTHOUR ('18: 34: 23') FROMBSEMPMS;
  
179. DOUBLE ()
If the parameter is a numeric expression, return the corresponding floating point number. If the parameter is a string expression, return the string expression of the number.
SELECTDOUBLE ('200') FROMBSEMPMS;
  
180. EXP ()
Returns the exponential function of the parameter.
SELECTEXP (2) FROMBSEMPMS;
  
181. FLOAT ()
Returns the floating point representation of a number.
SELECTFLOAT (789) FROMBSEMPMS;
  
182. FLOOR ()
Returns the maximum integer that is less than or equal to the parameter.
SELECTFLOOR (88.93) FROMBSEMPMS;
  
183. HEX ()
Returns a hexadecimal representation of the string value.
SELECTHEX (16) FROMBSEMPMS;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.