Files
doc-exports/docs/dli/sqlreference/dli_08_15088.html
Su, Xiaomeng be9eabe464 dli_sqlreference_20250305
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
Co-committed-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
2025-03-25 09:06:21 +00:00

242 lines
24 KiB
HTML

<a name="dli_08_15088"></a><a name="dli_08_15088"></a>
<h1 class="topictitle1">Arithmetic Functions</h1>
<div id="body0000001736916542">
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dli_08_15088__dli_08_0191_t5788dd0bf9554fa599615d5d6ef50bd0" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Arithmetic functions</caption><thead align="left"><tr id="dli_08_15088__dli_08_0191_r17f53737d83f42dd91e11b05c5ef9392"><th align="left" class="cellrowborder" valign="top" width="22.03%" id="mcps1.3.1.2.3.1.1"><p id="dli_08_15088__dli_08_0191_a46e572022abb44db90a6f9c5cba9d1c8"><strong id="dli_08_15088__b14796738103716">Operator</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="77.97%" id="mcps1.3.1.2.3.1.2"><p id="dli_08_15088__dli_08_0191_en-us_topic_0060575885_p412325091918"><strong id="dli_08_15088__b9994121118379">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="dli_08_15088__dli_08_0191_rd96d3136a53543528d45abdf96462414"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__dli_08_0191_a0a321b8ba44942148d6c2ac491fd81a1">+ numeric</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__dli_08_0191_a4334d8dede0b43d88a10cdf076f28a37">Returns a numeric.</p>
</td>
</tr>
<tr id="dli_08_15088__dli_08_0191_r0a7cdb128f944066a29ff0d903892175"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p49931249201711">- numeric</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__dli_08_0191_ad8dba2d6e0d04c879af1ffca48e578ae">Returns the opposite of a numeric.</p>
</td>
</tr>
<tr id="dli_08_15088__dli_08_0191_r0373068c718841758c0bb91fc8e785a0"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p62422595172">numeric1 + numeric2</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__dli_08_0191_en-us_topic_0060575885_p71238502199">Returns the sum of <strong id="dli_08_15088__b139561787397">numeric1</strong> and <strong id="dli_08_15088__b52781111203912">numeric2</strong>.</p>
</td>
</tr>
<tr id="dli_08_15088__dli_08_0191_rd113c20b1a164daaaa5909ba7967d599"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p1473411831810">numeric1 - numeric2</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__dli_08_0191_a74ccc9dbc4d04d18b55d8476a33811c6">Returns the difference between <strong id="dli_08_15088__b12699234143912">numeric1</strong> and <strong id="dli_08_15088__b1570916362390">numeric2</strong>.</p>
</td>
</tr>
<tr id="dli_08_15088__dli_08_0191_refeba9f4ead441b6bb8f62c3fddd7477"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p9594219141811">numeric1 * numberic2</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__dli_08_0191_a775d9e2640a1451f818270dfd1e27a2d">Returns the product of <strong id="dli_08_15088__b83205623914">numeric1</strong> and <strong id="dli_08_15088__b636785773916">numeric2</strong>.</p>
</td>
</tr>
<tr id="dli_08_15088__dli_08_0191_ra5c288930452472a9c82cb02aeae3e78"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p7519193020182">numeric1 / numeric2</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__p1298683517189">Returns the quotient of <strong id="dli_08_15088__b7627151315403">numeric1</strong> divided by <strong id="dli_08_15088__b2093514146402">numeric2</strong>.</p>
</td>
</tr>
<tr id="dli_08_15088__row153313455180"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p155334457187">numeric1 % numeric2</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__p1753304511810">Returns the remainder (modulus) of <strong id="dli_08_15088__b8594154111400">numeric1</strong> divided by <strong id="dli_08_15088__b1692811423409">numeric2</strong>. The result is negative only if <strong id="dli_08_15088__b1415185417404">numeric1</strong> is negative.</p>
</td>
</tr>
<tr id="dli_08_15088__dli_08_0191_ra5e716b7b3b04f2faf6d8d23cea57a85"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p041295511814">POWER(numeric1, numeric2)</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__dli_08_0191_a9a84ec01590840ee94979a3b31474f7b">Returns <strong id="dli_08_15088__b11653729154119">numeric1</strong> raised to the power of <strong id="dli_08_15088__b37455314416">numeric2</strong>.</p>
</td>
</tr>
<tr id="dli_08_15088__dli_08_0191_r32bec37757b44cd3a13ef7ac88a4d613"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p630925181918">ABS(numeric)</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__dli_08_0191_a84ef4817ed4b48a8800b0e66db4b1b06">Returns the absolute value of <strong id="dli_08_15088__b12577124619414">numeric</strong>.</p>
</td>
</tr>
<tr id="dli_08_15088__dli_08_0191_r19e91f04aaff4f9fbea75ebe462f9806"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__dli_08_0191_ae20b6e09b0c5427394f858eb5bfaa786">SQRT(numeric)</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__dli_08_0191_add5dfd9537734be2bebe2963e327ead5">Returns the square root of <strong id="dli_08_15088__b01571716144518">numeric</strong>.</p>
</td>
</tr>
<tr id="dli_08_15088__dli_08_0191_r4eac74693ac5401fb1391604b6e047df"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p186173671916">LN(numeric)</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__dli_08_0191_en-us_topic_0060575885_p3133513396">Returns the natural logarithm (base e) of <strong id="dli_08_15088__b7632193044517">numeric</strong>.</p>
</td>
</tr>
<tr id="dli_08_15088__dli_08_0191_r2e32804b55db4009a86288134dc8ebcf"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p56161148101913">LOG10(numeric)</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__dli_08_0191_aeac7417f50ab4b66bc7690af06b5f68c">Returns the logarithm (base 10) of <strong id="dli_08_15088__b8618746184513">numeric</strong>.</p>
</td>
</tr>
<tr id="dli_08_15088__row2301151610117"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p789131132017">LOG2(numeric)</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__p1630191620116">Returns the logarithm (base 2) of <strong id="dli_08_15088__b8555145164514">numeric</strong>.</p>
</td>
</tr>
<tr id="dli_08_15088__row1152510502110"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p16494413132013">LOG(numeric2) </p>
<p id="dli_08_15088__p52031557813">LOG(numeric1, numeric2)</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__p115997618710">When called with one argument, returns the natural logarithm of <strong id="dli_08_15088__b1012723214461">numeric2</strong>. When called with two arguments, returns the logarithm of <strong id="dli_08_15088__b680416549464">numeric2</strong> with base <strong id="dli_08_15088__b11765195619468">numeric1</strong>. <strong id="dli_08_15088__b523961018470">Numeric2</strong> must be greater than 0 and <strong id="dli_08_15088__b6962121416478">numeric1</strong> must be greater than 1.</p>
</td>
</tr>
<tr id="dli_08_15088__dli_08_0191_r868c97b04fc9410fa2a20a83a02c183d"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__dli_08_0191_en-us_topic_0060575885_p413195163919">EXP(numeric)</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__dli_08_0191_en-us_topic_0060575885_p435811119324">Returns <strong id="dli_08_15088__b1269602918476">e</strong> raised to the power of <strong id="dli_08_15088__b1721333134718">numeric</strong>.</p>
</td>
</tr>
<tr id="dli_08_15088__dli_08_0191_r059e4de339474830b760481bf7e344e5"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p883733852010">CEIL(numeric) </p>
<p id="dli_08_15088__p13528113717208">CEILING(numeric)</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__dli_08_0191_a122d9472b04a4161b02b0d2be79f831d">Rounds up and returns the smallest integer greater than or equal to <strong id="dli_08_15088__b1477450204715">numeric</strong>.</p>
</td>
</tr>
<tr id="dli_08_15088__dli_08_0191_rb3b4aac4b0364440a32dd626a3d3594c"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p1259695512208">FLOOR(numeric)</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__p93189018211">Rounds down and returns the largest integer less than or equal to <strong id="dli_08_15088__b19949161594816">numeric</strong>.</p>
</td>
</tr>
<tr id="dli_08_15088__dli_08_0191_rc90b798f1c9c42ecba7f086caf8d4fab"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p35525410217">SIN(numeric)</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__p52771796219">Returns the sine of <strong id="dli_08_15088__b82719321485">numeric</strong>.</p>
</td>
</tr>
<tr id="dli_08_15088__row6741920142119"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p274152062110">SINH(numeric)</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__p18741420112115">Returns the hyperbolic sine of <strong id="dli_08_15088__b18567154204912">numeric</strong>. The return type is <strong id="dli_08_15088__b115636502485">DOUBLE</strong>.</p>
</td>
</tr>
<tr id="dli_08_15088__dli_08_0191_en-us_topic_0060575885_row143425016"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p20259133082118">COS(numeric)</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__dli_08_0191_en-us_topic_0060575885_p10322807">Returns the tangent of <strong id="dli_08_15088__b137401331145314">numeric</strong>.</p>
</td>
</tr>
<tr id="dli_08_15088__dli_08_0191_en-us_topic_0060575885_row83821004"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__dli_08_0191_en-us_topic_0060575885_p103122305">TAN(numeric)</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__dli_08_0191_en-us_topic_0060575885_p1038216011">Calculates the tangent of given A.</p>
</td>
</tr>
<tr id="dli_08_15088__row13833115272118"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p083315242116">TANH(numeric)</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__p483410527216">Returns the hyperbolic tangent of <strong id="dli_08_15088__b3983181213548">numeric</strong>. The return type is <strong id="dli_08_15088__b931652144810">DOUBLE</strong>.</p>
</td>
</tr>
<tr id="dli_08_15088__dli_08_0191_en-us_topic_0060575885_row63142007"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p2151422222">COT(numeric)</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__p102251652213">Returns the cotangent of <strong id="dli_08_15088__b1796712619549">numeric</strong>.</p>
</td>
</tr>
<tr id="dli_08_15088__dli_08_0191_en-us_topic_0060575885_row13442602"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__dli_08_0191_en-us_topic_0060575885_p1841322020">ASIN(numeric)</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__dli_08_0191_en-us_topic_0060575885_p1842028015">Returns the inverse sine of <strong id="dli_08_15088__b1987323716548">numeric</strong>.</p>
</td>
</tr>
<tr id="dli_08_15088__dli_08_0191_en-us_topic_0060575885_row8482407"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p1184712062210">ACOS(numeric)</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__dli_08_0191_en-us_topic_0060575885_p134122702">Returns the inverse cosine of <strong id="dli_08_15088__b1660451105410">numeric</strong>.</p>
</td>
</tr>
<tr id="dli_08_15088__dli_08_0191_en-us_topic_0060575885_row1041621803"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p1184433514224">ATAN(numeric)</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__dli_08_0191_en-us_topic_0060575885_p141021803">Returns the inverse tangent of <strong id="dli_08_15088__b6193026195515">numeric</strong>.</p>
</td>
</tr>
<tr id="dli_08_15088__row1273312511012"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p67337510107">ATAN2(numeric1, numeric2)</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__p573318581010">Returns the inverse tangent of the coordinate (<strong id="dli_08_15088__b057514945517">numeric1</strong>, <strong id="dli_08_15088__b203171451165514">numeric2</strong>).</p>
</td>
</tr>
<tr id="dli_08_15088__row5224153441614"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p1205619172318">COSH(numeric)</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__p5224234121612">Returns the hyperbolic cosine of <strong id="dli_08_15088__b1046953165618">numeric</strong>. The return type is <strong id="dli_08_15088__b059141265618">DOUBLE</strong>.</p>
</td>
</tr>
<tr id="dli_08_15088__dli_08_0191_en-us_topic_0060575885_row34152200"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p7240133416237">DEGREES(numeric)</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__p635839202317">Returns the degree representation of the radian <strong id="dli_08_15088__b69221827205619">numeric</strong>.</p>
</td>
</tr>
<tr id="dli_08_15088__dli_08_0191_en-us_topic_0060575885_row1199798989"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p12637134312239">RADIANS(numeric)</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__p1091075310232">Returns the radian representation of the degree <strong id="dli_08_15088__b871104655619">numeric</strong>.</p>
</td>
</tr>
<tr id="dli_08_15088__dli_08_0191_r68256be09fe84c77aef5d47411e65ce3"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p1542755862310">SIGN(numeric)</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__dli_08_0191_en-us_topic_0060575885_p11998198083">Returns the sign of <strong id="dli_08_15088__b15856205765614">numeric</strong>.</p>
</td>
</tr>
<tr id="dli_08_15088__dli_08_0191_r2feb0685ca04407fa2657fa9ceb758c5"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p11674710122415">ROUND(numeric, INT)</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__dli_08_0191_ae767070bdf654de288573cb191ca23d3">Returns the value of <strong id="dli_08_15088__b1864121412577">numeric</strong> rounded to <strong id="dli_08_15088__b12162123595717">INT</strong> decimal places.</p>
</td>
</tr>
<tr id="dli_08_15088__dli_08_0191_r2627acb48fda48adab51a14a81b8be5a"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p52791822192416">PI()</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__dli_08_0191_a853ee394856f4b8f9f18d21bf3891888">Returns a value very close to <strong id="dli_08_15088__b2571154125713">pi</strong>.</p>
</td>
</tr>
<tr id="dli_08_15088__row798162010285"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p93323015241">E()</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__p1411535102415">Returns a value very close to <strong id="dli_08_15088__b89153121585">e</strong>.</p>
</td>
</tr>
<tr id="dli_08_15088__row125241224152815"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p38751539152417">RAND()</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__p752412242288">Returns a pseudo-random double-precision value within the range of [0.0, 1.0).</p>
</td>
</tr>
<tr id="dli_08_15088__row14407112672813"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p6784145010240">RAND(INT)</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__p7152432172614">Returns a pseudo-random double-precision value within the range of [0.0, 1.0) with an initial seed of <strong id="dli_08_15088__b1190819411414">INT</strong>.</p>
<p id="dli_08_15088__p9831135518242">If two RAND functions have the same initial seed, they will return the same sequence of numbers.</p>
</td>
</tr>
<tr id="dli_08_15088__row1853572812286"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p187549313252">RAND_INTEGER(INT)</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__p1353532813282">Returns a pseudo-random integer within the range of [0, INT).</p>
</td>
</tr>
<tr id="dli_08_15088__row17762133072819"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p93699134253">RAND_INTEGER(INT1, INT2)</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__p85431430122611">Returns a pseudo-random integer within the range of [0, INT2) with an initial seed of <strong id="dli_08_15088__b1988517313216">INT1</strong>.</p>
<p id="dli_08_15088__p1341101872516">If two RAND_INTEGER functions have the same initial seed and boundary, they will return the same sequence of numbers.</p>
</td>
</tr>
<tr id="dli_08_15088__row12959173212814"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p145831623102513">UUID()</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__p208967253266">Returns a universally unique identifier (UUID) string based on RFC 4122 type 4 (pseudo-random generated).</p>
<p id="dli_08_15088__p18959133213289">For example, <strong id="dli_08_15088__b203211411157">3d3c68f7-f608-473f-b60c-b0c44ad4cc4e</strong> is generated using a cryptographically strong pseudo-random number generator.</p>
</td>
</tr>
<tr id="dli_08_15088__row10150193516283"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p8693193652518">BIN(INT)</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__p1783826102613">Returns the string representation of <strong id="dli_08_15088__b13554163076">INTEGER</strong> in binary format. If <strong id="dli_08_15088__b89961712664">INTEGER</strong> is <strong id="dli_08_15088__b28855141967">NULL</strong>, returns <strong id="dli_08_15088__b1914121713615">NULL</strong>.</p>
<p id="dli_08_15088__p18150035112819">For example, <strong id="dli_08_15088__b183881132269">4.bin()</strong> returns <strong id="dli_08_15088__b167567381161">"100"</strong>, and <strong id="dli_08_15088__b81868421964">12.bin()</strong> returns <strong id="dli_08_15088__b1781215451616">"1100"</strong>.</p>
</td>
</tr>
<tr id="dli_08_15088__row12189153712814"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p740513474255">HEX(numeric)</p>
<p id="dli_08_15088__p1539325484110">HEX(string)</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__p34531028122617">Returns the string representation of the <strong id="dli_08_15088__b11394322161610">numeric</strong> value or <strong id="dli_08_15088__b209818274167">STRING</strong> in hexadecimal format. If the parameter is <strong id="dli_08_15088__b43109119160">NULL</strong>, returns <strong id="dli_08_15088__b27888414163">NULL</strong>.</p>
<p id="dli_08_15088__p41894372283">For example, the number 20 returns <strong id="dli_08_15088__b27853302222">"14"</strong>, the number 100 returns <strong id="dli_08_15088__b6649113452218">"64"</strong>, and the string "hello,world" returns <strong id="dli_08_15088__b1836124519221">"68656C6C6F2C776F726C64"</strong>.</p>
</td>
</tr>
<tr id="dli_08_15088__row104138390284"><td class="cellrowborder" valign="top" width="22.03%" headers="mcps1.3.1.2.3.1.1 "><p id="dli_08_15088__p1628219512265">TRUNCATE(numeric1, integer2)</p>
</td>
<td class="cellrowborder" valign="top" width="77.97%" headers="mcps1.3.1.2.3.1.2 "><p id="dli_08_15088__p831441614265">Returns the number with <strong id="dli_08_15088__b14395172112316">integer2</strong> decimal places truncated. If <strong id="dli_08_15088__b1275143062315">numeric1</strong> or <strong id="dli_08_15088__b11744173702319">integer2</strong> is <strong id="dli_08_15088__b10480173916238">NULL</strong>, returns <strong id="dli_08_15088__b136811246202319">NULL</strong>.</p>
<p id="dli_08_15088__p5783201914261">If <strong id="dli_08_15088__b172846518247">integer2</strong> is <strong id="dli_08_15088__b662520710249">0</strong>, the result has no decimal point or decimal part. <strong id="dli_08_15088__b16978152712420">integer2</strong> can be negative, making the <strong id="dli_08_15088__b1670113372418">integer2</strong> digits to the left of the decimal point zero.</p>
<p id="dli_08_15088__p71281523182617">This function can also be called with only one <strong id="dli_08_15088__b4336838254">numeric1</strong> parameter and without setting <strong id="dli_08_15088__b145389109258">integer2</strong>.</p>
<p id="dli_08_15088__p1437171020264">If <strong id="dli_08_15088__b172615292259">integer2</strong> is not set, it defaults to <strong id="dli_08_15088__b19185133814251">0</strong>. For example, <strong id="dli_08_15088__b1761258182511">42.324.truncate(2)</strong> is <strong id="dli_08_15088__b1462519872617">42.32</strong>, and <strong id="dli_08_15088__b199344228263">42.324.truncate()</strong> is <strong id="dli_08_15088__b63381326172620">42.0</strong>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dli_08_15085.html">Built-In Functions</a></div>
</div>
</div>