doc-exports/docs/dws/dev/dws_04_0042.html
Lu, Huayi ef0ada5a59 DWS DEV 20240716 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2024-11-02 09:07:47 +00:00

316 lines
36 KiB
HTML

<a name="EN-US_TOPIC_0000001510402309"></a><a name="EN-US_TOPIC_0000001510402309"></a>
<h1 class="topictitle1">Syntax Compatibility Differences Among Oracle, Teradata, and MySQL</h1>
<div id="body1592275924795"><p id="EN-US_TOPIC_0000001510402309__p209404167533"><span id="EN-US_TOPIC_0000001510402309__text1336221157">GaussDB(DWS)</span> is compatible with Oracle, Teradata and MySQL syntax, of which the syntax behavior is different.</p>
<p id="EN-US_TOPIC_0000001510402309__p132941739101019">The database compatibility model can be specified using the <strong id="EN-US_TOPIC_0000001510402309__b3981121566">DBCOMPATIBILITY</strong> parameter when creating a database. For details, refer to the <strong id="EN-US_TOPIC_0000001510402309__b106984814611">CREATE DATABASE</strong> syntax.</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001510402309__screen237010474813"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">CREATE</span><span class="w"> </span><span class="k">DATABASE</span><span class="w"> </span><span class="n">ora_compatible_db</span><span class="w"> </span><span class="n">DBCOMPATIBILITY</span><span class="w"> </span><span class="s1">'ORA'</span><span class="p">;</span>
</pre></div></td></tr></table></div>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001510402309__table230618257361" width="100%" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Compatibility differences</caption><thead align="left"><tr id="EN-US_TOPIC_0000001510402309__row16306172513612"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.2.5.1.1"><p id="EN-US_TOPIC_0000001510402309__p459013153373">Compatibility Item</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="24%" id="mcps1.3.4.2.5.1.2"><p id="EN-US_TOPIC_0000001510402309__p5307102514362">Oracle</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="28.000000000000004%" id="mcps1.3.4.2.5.1.3"><p id="EN-US_TOPIC_0000001510402309__p1862122742011">Teradata</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="28.000000000000004%" id="mcps1.3.4.2.5.1.4"><p id="EN-US_TOPIC_0000001510402309__p590421182015">MySQL</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001510402309__row11307152517361"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001510402309__p230732543614">Empty string</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001510402309__p12695932142314">Only <strong id="EN-US_TOPIC_0000001510402309__b1676171211475">null</strong> is available.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001510402309__p182181744102117">An empty string is distinguished from <strong id="EN-US_TOPIC_0000001510402309__b12508152152610">null</strong>.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001510402309__p10996544162113">An empty string is distinguished from <strong id="EN-US_TOPIC_0000001510402309__b11750912614">null</strong>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510402309__row1930812518362"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001510402309__p163087257366">Conversion of an empty string to a number</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001510402309__p230812513614">null</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001510402309__p1778914716212">0</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001510402309__p16550048172117">0</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510402309__row1782911386376"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001510402309__p38301438183717">Automatic truncation of overlong characters</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001510402309__p1783013816372">Not supported</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001510402309__p7621132782017">Supported (set GUC parameter <strong id="EN-US_TOPIC_0000001510402309__b1497572115116">td_compatible_truncation</strong> to <strong id="EN-US_TOPIC_0000001510402309__b7372162519114">ON</strong>)</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001510402309__p790112172012">Not supported</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510402309__row9188121173115"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001510402309__p1446816521433"><strong id="EN-US_TOPIC_0000001510402309__b16403155113418">null</strong> concatenation</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001510402309__p1989491612265">Returns a non-null object after combining a non-null object with <strong id="EN-US_TOPIC_0000001510402309__b197889573343">null</strong>.</p>
<p id="EN-US_TOPIC_0000001510402309__p54687521033">For example, <strong id="EN-US_TOPIC_0000001510402309__b13566821947">'abc'||null</strong> returns <strong id="EN-US_TOPIC_0000001510402309__b3573321548">'abc'</strong>.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001510402309__p8978183226">The <strong id="EN-US_TOPIC_0000001510402309__b15538192411417">strict_text_concat_td</strong> option is added to the GUC parameter <strong id="EN-US_TOPIC_0000001510402309__b1153822417413">behavior_compat_options</strong> to be compatible with the Teradata behavior. After the null type is concatenated, <strong id="EN-US_TOPIC_0000001510402309__b253932419412">null</strong> is returned.</p>
<p id="EN-US_TOPIC_0000001510402309__p29791882215">For example, <strong id="EN-US_TOPIC_0000001510402309__b166693268413">'abc'||null</strong> returns <strong id="EN-US_TOPIC_0000001510402309__b5669226948">null</strong>.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001510402309__p562514224223">Compatible with MySQL behavior. After the null type is concatenated, <strong id="EN-US_TOPIC_0000001510402309__b20533857618">null</strong> is returned.</p>
<p id="EN-US_TOPIC_0000001510402309__p162532210221">For example, <strong id="EN-US_TOPIC_0000001510402309__b71467968">'abc'||null</strong> returns <strong id="EN-US_TOPIC_0000001510402309__b111527862">null</strong>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510402309__row118912114319"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001510402309__p378817330148">Concatenation of the char(n) type</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001510402309__p42003142268">Removes spaces and placeholders on the right when the char(n) type is concatenated.</p>
<p id="EN-US_TOPIC_0000001510402309__p167881633131416">For example, <strong id="EN-US_TOPIC_0000001510402309__b952852015818">cast('a' as char(3))||'b'</strong> returns <strong id="EN-US_TOPIC_0000001510402309__b55341720187">'ab'</strong>.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001510402309__p4641102616227">After the <strong id="EN-US_TOPIC_0000001510402309__b32220220815">bpchar_text_without_rtrim</strong> option is added to the GUC parameter <strong id="EN-US_TOPIC_0000001510402309__b2222522887">behavior_compat_options</strong>, when the char(n) type is concatenated, spaces are reserved and supplemented to the specified length <em id="EN-US_TOPIC_0000001510402309__i3223222489">n</em>.</p>
<p id="EN-US_TOPIC_0000001510402309__p14924174414396">Currently, ignoring spaces at the end of a string for comparison is not supported. If the concatenated string contains spaces at the end, the comparison is space-sensitive.</p>
<p id="EN-US_TOPIC_0000001510402309__p96411826102211">For example, <strong id="EN-US_TOPIC_0000001510402309__b19911841121017">cast('a' as char(3))||'b'</strong> returns <strong id="EN-US_TOPIC_0000001510402309__b1697144111011">'a b'</strong>.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001510402309__p117721629132212">Removes spaces and placeholders on the right.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510402309__row522617415294"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001510402309__p34894238291">concat(str1,str2)</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001510402309__p94901234296">Returns the concatenation of all non-null strings.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001510402309__p5490142382913">Returns the concatenation of all non-null strings.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001510402309__p18490152362916">If an input parameter is <strong id="EN-US_TOPIC_0000001510402309__b1519535618234">null</strong>, <strong id="EN-US_TOPIC_0000001510402309__b519605682315">null</strong> is returned.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510402309__row116364823716"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001510402309__p48458194111">left and right processing of negative values</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001510402309__p38175816412">Returns all characters except the first and last |n| characters.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001510402309__p189155820417">Returns all characters except the first and last |n| characters.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001510402309__p189195874119">Returns an empty string.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510402309__row6644171423720"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001510402309__p1039016269424">lpad(string text, length int [, fill text])</p>
<p id="EN-US_TOPIC_0000001510402309__p163906262428">rpad(string text, length int [, fill text])</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001510402309__p439122617426">Fills up the string to the specified <strong id="EN-US_TOPIC_0000001510402309__b646115222511">length</strong> by appending the <strong id="EN-US_TOPIC_0000001510402309__b19756428112113">fill</strong> characters (a space by default). If the string is already longer than <strong id="EN-US_TOPIC_0000001510402309__b56213642212">length</strong> then it is truncated (on the right). If <strong id="EN-US_TOPIC_0000001510402309__b183734872718">fill</strong> is an empty string or <strong id="EN-US_TOPIC_0000001510402309__b1055451315272">length</strong> is a negative number, <strong id="EN-US_TOPIC_0000001510402309__b14813737162719">null</strong> is returned.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001510402309__p1139117261424">If <strong id="EN-US_TOPIC_0000001510402309__b10553124312271">fill</strong> is an empty string and the string length is less than the specified <strong id="EN-US_TOPIC_0000001510402309__b16248151318518">length</strong>, the original string is returned. If <strong id="EN-US_TOPIC_0000001510402309__b02105313513">length</strong> is a negative number, an empty string is returned.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001510402309__p16391182612429">If <strong id="EN-US_TOPIC_0000001510402309__b5415183272811">fill</strong> is an empty string and the string length is less than the specified <strong id="EN-US_TOPIC_0000001510402309__b13416632132818">length</strong>, an empty string is returned. If <strong id="EN-US_TOPIC_0000001510402309__b2041693262810">length</strong> is a negative number, <strong id="EN-US_TOPIC_0000001510402309__b14171032162813">null</strong> is returned.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510402309__row199339231664"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001510402309__p3933123961">substr(str, s[, n])</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001510402309__p149334231169">If <strong id="EN-US_TOPIC_0000001510402309__b1036419459514">s</strong> is set to 0, the first n characters are returned.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001510402309__p179331231868">If <strong id="EN-US_TOPIC_0000001510402309__b551219236527">s</strong> is set to 0, the first n characters are returned.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001510402309__p1493392311618">If <strong id="EN-US_TOPIC_0000001510402309__b953993145211">s</strong> is set to 0, an empty string is returned.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510402309__row1892311250611"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001510402309__p87910266165">substring(str, s[, n])</p>
<p id="EN-US_TOPIC_0000001510402309__p992352518612">substring(str [from s] [for n])</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001510402309__p4923152510611">If <strong id="EN-US_TOPIC_0000001510402309__b1636098154210">s</strong> is set to 0, the first n - 1 characters are returned.</p>
<p id="EN-US_TOPIC_0000001510402309__p1868154171419">If <strong id="EN-US_TOPIC_0000001510402309__b155565018428">s</strong> is &lt; 0, the first s + n - 1 characters are returned.</p>
<p id="EN-US_TOPIC_0000001510402309__p1924514481819">If <strong id="EN-US_TOPIC_0000001510402309__b16187172934317">n</strong> is &lt; 0, an error is reported.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001510402309__p19923152519619">If <strong id="EN-US_TOPIC_0000001510402309__b9227163816436">s</strong> is set to 0, the first n - 1 characters are returned.</p>
<p id="EN-US_TOPIC_0000001510402309__p133801457111419">If <strong id="EN-US_TOPIC_0000001510402309__b12801194515439">s</strong> is &lt; 0, the first s + n - 1 characters are returned.</p>
<p id="EN-US_TOPIC_0000001510402309__p19166581321">If <strong id="EN-US_TOPIC_0000001510402309__b10616184449">n</strong> is &lt; 0, an error is reported.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001510402309__p1992372519612">If <strong id="EN-US_TOPIC_0000001510402309__b358491416441">s</strong> is set to 0, an empty string is returned.</p>
<p id="EN-US_TOPIC_0000001510402309__p185191455153">If <strong id="EN-US_TOPIC_0000001510402309__b8641627174414">s</strong> is &lt; 0, n characters starting from the last |s| character are truncated.</p>
<p id="EN-US_TOPIC_0000001510402309__p859021018219">If <strong id="EN-US_TOPIC_0000001510402309__b151047354451">n</strong> is &lt; 0, an empty string is returned.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510402309__row78771530493"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001510402309__p7878330995">trim, ltrim, rtrim, btrim(string[,characters])</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001510402309__p187818301498">Removes the longest string that contains only the characters (a space by default) in the <em id="EN-US_TOPIC_0000001510402309__i1759753718428">characters</em> from a specified position of the <em id="EN-US_TOPIC_0000001510402309__i797416518403">string</em>.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001510402309__p1287819301192">Removes the longest string that contains only the characters (a space by default) in the <em id="EN-US_TOPIC_0000001510402309__i12325111210435">characters</em> from a specified position of the <em id="EN-US_TOPIC_0000001510402309__i19325212174310">string</em>.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001510402309__p168789305914">Removes the string that is equivalent to characters (a space by default) from a specified position of the <em id="EN-US_TOPIC_0000001510402309__i1824005119442">string</em>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510402309__row9598103523714"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001510402309__p1886474764213">log(x)</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001510402309__p17864164764213">Returns the logarithm with 10 as the base.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001510402309__p8865124714427">Returns the logarithm with 10 as the base.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001510402309__p158651347184215">Returns the natural logarithm.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510402309__row989941743814"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001510402309__p13900151753810">mod(x, 0)</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001510402309__p79001817123812">Returns x if the divisor is 0.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001510402309__p139008177384">Returns x if the divisor is 0.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001510402309__p16900217193812">Reports an error if the divisor is 0.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510402309__row259813350378"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001510402309__p1584417264432">date data type</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001510402309__p58448268431">Converts the date data type to the timestamp data type which stores year, month, day, hour, minute, and second values.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001510402309__p5844182613433">Stores year and month values.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001510402309__p484411268435">Stores year and month values.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510402309__row91551941152814"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001510402309__p17667211164418">to_char(date)</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001510402309__p866721111449">The maximum value of the input parameter can only be the maximum value of the timestamp type. The maximum value of the date type is not supported. The return value is of the timestamp type.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001510402309__p56671811134413">The maximum value of the input parameter can only be the maximum value of the timestamp type. The maximum value of the date type is not supported. The return value is of the date type in YYYY/MM/DD format. (The GUC parameter <strong id="EN-US_TOPIC_0000001510402309__b135511419175410">convert_empty_str_to_null_td</strong> is enabled.)</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001510402309__p14667111154410">Only the timestamp type and the date type support the maximum input value. The return value is of the date type.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510402309__row13663154611437"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001510402309__p3305125694318">to_date, to_timestamp, and to_number processing of empty strings</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001510402309__p93051856104312">Returns <strong id="EN-US_TOPIC_0000001510402309__b7403171914385">null</strong>.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001510402309__p1430610563439">Returns <strong id="EN-US_TOPIC_0000001510402309__b3119631125218">null</strong>. (The <strong id="EN-US_TOPIC_0000001510402309__b46111375318">convert_empty_str_to_null_td</strong> parameter is enabled.)</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001510402309__p20306456114313"><strong id="EN-US_TOPIC_0000001510402309__b137501734153312">to_date</strong> and <strong id="EN-US_TOPIC_0000001510402309__b875643416332">to_timestamp</strong> returns <strong id="EN-US_TOPIC_0000001510402309__b3757113416339">null</strong>. If the parameter passed to <strong id="EN-US_TOPIC_0000001510402309__b18757183412333">to_number</strong> is an empty string, <strong id="EN-US_TOPIC_0000001510402309__b197571434153317">0</strong> is returned.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510402309__row1171832863914"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001510402309__p971962812393">Return value types of last_day and next_day</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001510402309__p13719182814399">Returns values of the timestamp type.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001510402309__p2719228173918">Returns values of the timestamp type.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001510402309__p127191628123916">Returns values of the date type.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510402309__row6234141014385"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001510402309__p1223451010386">Return value type of add_months</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001510402309__p112341710123810">Returns values of the timestamp type.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001510402309__p623512108386">Returns values of the timestamp type.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001510402309__p92351410143814">If the input parameter is of the date type, the return value is of the date type.</p>
<p id="EN-US_TOPIC_0000001510402309__p13244151783910">If the input parameter is of the timestamp type, the return value is of the timestamp type.</p>
<p id="EN-US_TOPIC_0000001510402309__p948214349390">If the input parameter is of the timestamptz type, the return value is of the timestamptz type.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510402309__row94321953124420"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001510402309__p144751003455">CURRENT_TIME</p>
<p id="EN-US_TOPIC_0000001510402309__p1447613074513">CURRENT_TIME(p)</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001510402309__p1247613018451">Obtains the time of the current transaction. The return value is of the timetz type.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001510402309__p647613014511">Obtains the time of the current transaction. The return value is of the timetz type.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001510402309__p174764054516">Obtains the execution time of the current statement. The return value is of the time type.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510402309__row1736081718392"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001510402309__p16361517133913">CURRENT_TIMESTAMP</p>
<p id="EN-US_TOPIC_0000001510402309__p6920349174813">CURRENT_TIMESTAMP(p)</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001510402309__p11361417153920">Obtains the execution time of the current statement. The return value is of the timestamptz type.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001510402309__p19361217153913">Obtains the execution time of the current statement. The return value is of the timestamptz type.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001510402309__p136113175394">Obtains the execution time of the current statement. The return value is of the timestamp type.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510402309__row1737792805312"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001510402309__p13378152875317">CURDATE</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001510402309__p10378132814531">Not supported</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001510402309__p1337832814537">Not supported</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001510402309__p837815289538">Obtains the execution date of the current statement. The return value is of the date type.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510402309__row194338019555"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001510402309__p1243412045517">CURTIME(p)</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001510402309__p11434110165511">Not supported</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001510402309__p5434110105516">Not supported</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001510402309__p24348055516">Obtains the execution time of the current statement. The return value is of the time type.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510402309__row154861311114010"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001510402309__p44861011184011">LOCALTIME</p>
<p id="EN-US_TOPIC_0000001510402309__p10145919174913">LOCALTIME(p)</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001510402309__p6486111104011">Obtains the time of the current transaction. The return value is of the time type.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001510402309__p184861711134017">Obtains the time of the current transaction. The return value is of the time type.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001510402309__p1748713118408">Obtains the execution time of the current statement. The return value is of the timestamp type.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510402309__row926632615401"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001510402309__p1926642644013">LOCALTIMESTAMP</p>
<p id="EN-US_TOPIC_0000001510402309__p16443192794911">LOCALTIMESTAMP(p)</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001510402309__p5266132614018">Obtains the time of the current transaction. The return value is of the timestamp type.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001510402309__p926612611408">Obtains the time of the current transaction. The return value is of the timestamp type.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001510402309__p112668266403">Obtains the execution time of the current statement. The return value is of the timestamp type.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510402309__row35423371409"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001510402309__p95421737184018">SYSDATE</p>
<p id="EN-US_TOPIC_0000001510402309__p01741538134917">SYSDATE(p)</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001510402309__p4542163774016">Obtains the execution time of the current statement. The return value is of the timestamp(0) type.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001510402309__p1654243719407">Obtains the execution time of the current statement. The return value is of the timestamp(0) type.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001510402309__p55421372407">Obtains the current system time. The return value is of the timestamp(0) type. This function cannot be pushed down. You are advised to use current_date instead.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510402309__row06861885201"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001510402309__p868748162016">now()</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001510402309__p12687085203">Obtains the time of the current transaction. The return value is of the timestamptz type.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001510402309__p568708152011">Obtains the time of the current transaction. The return value is of the timestamptz type.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001510402309__p9687181204">Obtains the statement execution time. The return value is of the timestamptz type.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510402309__row20538528192719"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001510402309__p34802054142716">Operator ^</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001510402309__p1048035412279">Performs exponentiation.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001510402309__p54815544271">Performs exponentiation.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001510402309__p1848115549278">Performs the exclusive OR operation.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510402309__row11644141555019"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001510402309__p1864551575011">Expressions GREATEST and LEAST</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001510402309__p16645161585015">Returns the comparison results of all non-null input parameters.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001510402309__p1645191565013">Returns the comparison results of all non-null input parameters.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001510402309__p196457156504">If an input parameter is <strong id="EN-US_TOPIC_0000001510402309__b14448184443919">null</strong>, <strong id="EN-US_TOPIC_0000001510402309__b644864453914">null</strong> is returned.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510402309__row3539122872710"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001510402309__p185844620281">Different input parameter types of CASE, COALESCE, IF, and IFNULL expressions</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001510402309__p195848615283">Reports error.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001510402309__p65848632820">Is compatible with behavior of Teradata and supports type conversion between digits and strings. For example, if input parameters for COALESCE are of INT and VARCHAR types, the parameters are resolved as VARCHAR type.</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001510402309__p105843612814">Is compatible with behavior of MySQL and supports type conversion between strings and other types. For example, if input parameters for COALESCE are of DATE, INT, and VARCHAR types, the parameters are resolved as VARCHAR type.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510402309__row177871757144211"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001510402309__p16788135724210">Backquote (`)</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001510402309__p17788185734214">Not supported</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001510402309__p16788195784210">Not supported</p>
</td>
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001510402309__p57884575427">Distinguishes MySQL reserved words from common characters.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>