<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>OpenText Analytics Database 26.2.x – Operators</title>
    <link>/en/sql-reference/language-elements/operators/</link>
    <description>Recent content in Operators on OpenText Analytics Database 26.2.x</description>
    <generator>Hugo -- gohugo.io</generator>
    
	  <atom:link href="/en/sql-reference/language-elements/operators/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Sql-Reference: Bitwise operators</title>
      <link>/en/sql-reference/language-elements/operators/bitwise-operators/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/language-elements/operators/bitwise-operators/</guid>
      <description>
        
        
        &lt;p&gt;Bitwise operators perform bit manipulations on INTEGER and BINARY/VARBINARY data types:

&lt;table class=&#34;table table-bordered&#34; &gt;



&lt;tr&gt; 

&lt;th &gt;
Operator&lt;/th&gt; 

&lt;th &gt;
Description&lt;/th&gt; 

&lt;th &gt;
Example&lt;/th&gt; 

&lt;th &gt;
Result&lt;/th&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;code&gt;&amp;amp;&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


AND&lt;/td&gt; 


&lt;td  class=&#34;hright&#34; &gt;
&lt;code&gt;12 &amp;amp; 4&lt;/code&gt;&lt;/td&gt; 


&lt;td  class=&#34;hright&#34; &gt;
&lt;code&gt;4&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;code&gt;|&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;
OR&lt;/td&gt; 


&lt;td  class=&#34;hright&#34; &gt;
&lt;code&gt;32 | 3&lt;/code&gt;&lt;/td&gt; 


&lt;td  class=&#34;hright&#34; &gt;
&lt;code&gt;35&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;code&gt;#&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


XOR&lt;/td&gt; 


&lt;td  class=&#34;hright&#34; &gt;
&lt;code&gt;17 # 5&lt;/code&gt;&lt;/td&gt; 


&lt;td  class=&#34;hright&#34; &gt;
&lt;code&gt;20&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;code&gt;~&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;
NOT&lt;/td&gt; 


&lt;td  class=&#34;hright&#34; &gt;
&lt;code&gt;~1&lt;/code&gt;&lt;/td&gt; 


&lt;td  class=&#34;hright&#34; &gt;
&lt;code&gt;-2&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;code&gt;&amp;lt;&amp;lt;&lt;/code&gt; &lt;sup&gt;†&lt;/sup&gt;&lt;/td&gt; 

&lt;td &gt;
Bitwise shift left&lt;/td&gt; 


&lt;td  class=&#34;hright&#34; &gt;
&lt;code&gt;1 &amp;lt;&amp;lt; 4&lt;/code&gt;&lt;/td&gt; 


&lt;td  class=&#34;hright&#34; &gt;
&lt;code&gt;16&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;code&gt;&amp;gt;&amp;gt;&lt;/code&gt; &lt;sup&gt;†&lt;/sup&gt;&lt;/td&gt; 

&lt;td &gt;


Bitwise shift right&lt;/td&gt; 


&lt;td  class=&#34;hright&#34; &gt;
&lt;code&gt;8 &amp;gt;&amp;gt; 2&lt;/code&gt;&lt;/td&gt; 


&lt;td  class=&#34;hright&#34; &gt;
&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/p&gt;
&lt;p&gt;&lt;sup&gt;†&lt;/sup&gt; Invalid for BINARY/VARBINARY data types&lt;/p&gt;
&lt;h2 id=&#34;string-argument-handling&#34;&gt;String argument handling&lt;/h2&gt;
&lt;p&gt;String arguments must be explicitly cast as BINARY or VARBINARY data types for all bitwise operators. For example:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT &amp;#39;xyz&amp;#39;::VARBINARY &amp;amp; &amp;#39;zyx&amp;#39;::VARBINARY AS AND;
 AND
-----
 xyx
(1 row)

=&amp;gt; SELECT &amp;#39;xyz&amp;#39;::VARBINARY | &amp;#39;zyx&amp;#39;::VARBINARY AS OR;
 OR
-----
 zyz
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Bitwise operators treats all string arguments as equal in length. If the arguments have different lengths, the operator function right-pads the smaller string with one or more zero bytes to equal the length of the larger string.&lt;/p&gt;
&lt;p&gt;For example, the following statement ANDs unequal strings &lt;code&gt;xyz&lt;/code&gt; and &lt;code&gt;zy&lt;/code&gt;. OpenText™ Analytics Database right-pads string &lt;code&gt;zy&lt;/code&gt; with one zero byte. The last character in the result is represented accordingly, as &lt;code&gt;\000&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT &amp;#39;xyz&amp;#39;::VARBINARY &amp;amp; &amp;#39;zy&amp;#39;::VARBINARY AS AND;
  AND
--------
 xy\000
(1 row)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: Logical operators</title>
      <link>/en/sql-reference/language-elements/operators/logical-operators/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/language-elements/operators/logical-operators/</guid>
      <description>
        
        
        &lt;p&gt;OpenText™ Analytics Database supports the logical operators AND, OR, and NOT:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;AND evaluates to true when both of the conditions joined by AND are true.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;OR evaluates to true when either condition is true.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;NOT negates the result of any Boolean expression.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;AND and OR are commutative—that is, you can switch left and right operands without affecting the result. However, the order of evaluation of sub-expressions is not defined. To force evaluation order, use a &lt;a href=&#34;../../../../en/sql-reference/language-elements/expressions/case-expressions/&#34;&gt;CASE&lt;/a&gt; construct.

&lt;div class=&#34;admonition caution&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Caution&lt;/h4&gt;

Do not confuse Boolean operators with the &lt;a href=&#34;../../../../en/sql-reference/language-elements/predicates/boolean/&#34;&gt;Boolean predicate&lt;/a&gt; or &lt;a href=&#34;../../../../en/sql-reference/data-types/boolean-data-type/&#34;&gt;Boolean&lt;/a&gt; data type, which can have only two values: true and false.

&lt;/div&gt;&lt;/p&gt;
&lt;h2 id=&#34;logic&#34;&gt;Logic&lt;/h2&gt;
&lt;p&gt;SQL uses a three-valued Boolean logic where &lt;code&gt;NULL&lt;/code&gt; represents &amp;quot;unknown&amp;quot;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;true&lt;/code&gt; AND &lt;code&gt;NULL&lt;/code&gt; = &lt;code&gt;NULL&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;true&lt;/code&gt; OR &lt;code&gt;NULL&lt;/code&gt; = &lt;code&gt;true&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;false&lt;/code&gt; AND &lt;code&gt;NULL&lt;/code&gt; = &lt;code&gt;false&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;false&lt;/code&gt; OR &lt;code&gt;NULL&lt;/code&gt; = &lt;code&gt;NULL&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;NULL&lt;/code&gt; AND &lt;code&gt;NULL&lt;/code&gt; = &lt;code&gt;NULL&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;NULL&lt;/code&gt; OR &lt;code&gt;NULL&lt;/code&gt; = &lt;code&gt;NULL&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;NOT &lt;code&gt;NULL&lt;/code&gt; = &lt;code&gt;NULL&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: Comparison operators</title>
      <link>/en/sql-reference/language-elements/operators/comparison-operators/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/language-elements/operators/comparison-operators/</guid>
      <description>
        
        
        &lt;p&gt;Comparison operators are available for all data types where comparison makes sense. All comparison operators are binary operators that return values of true, false, or NULL (unknown).

&lt;table class=&#34;table table-bordered&#34; &gt;



&lt;tr&gt; 

&lt;th &gt;
Operator&lt;/th&gt; 

&lt;th &gt;
Description&lt;/th&gt; 

&lt;th &gt;
Binary function&lt;/th&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;code&gt;&amp;lt;&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


less than&lt;/td&gt; 

&lt;td &gt;
&lt;code&gt;binary_lt&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;code&gt;&amp;gt;&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


greater than&lt;/td&gt; 

&lt;td &gt;
&lt;code&gt;binary_gt&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;code&gt;&amp;lt;=&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


less than or equal to&lt;/td&gt; 

&lt;td &gt;
&lt;code&gt;binary_le&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;code&gt;&amp;gt;=&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


greater than or equal to&lt;/td&gt; 

&lt;td &gt;
&lt;code&gt;binary_ge&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;code&gt;=&lt;/code&gt;, &lt;code&gt;&amp;lt;=&amp;gt;&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;









&lt;p&gt;equal&lt;/p&gt;
&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;
&lt;p&gt;Do not use the negation operator (&lt;code&gt;!&lt;/code&gt;) with the &lt;code&gt;&amp;lt;=&amp;gt;&lt;/code&gt; operator. Instead, use &lt;code&gt;!=&lt;/code&gt; to test for inequality. &lt;code&gt;!&lt;/code&gt;, except as part of &lt;code&gt;!=&lt;/code&gt;, is the factorial operator.&lt;/p&gt;
&lt;/div&gt;
&lt;/td&gt; 

&lt;td &gt;
&lt;code&gt;binary_eq&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;code&gt;!=&lt;/code&gt;, &lt;code&gt;&amp;lt;&amp;gt;&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


not equal (unsupported for correlated subqueries)&lt;/td&gt; 

&lt;td &gt;
&lt;code&gt;binary_ne&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/p&gt;
&lt;h2 id=&#34;null-handling&#34;&gt;NULL handling&lt;/h2&gt;
&lt;p&gt;Comparison operators return NULL (unknown) if either or both operands are null, with one exception: &lt;code&gt;&amp;lt;=&amp;gt;&lt;/code&gt; returns true if both operands are NULL, and false if one operand is NULL.&lt;/p&gt;
&lt;h2 id=&#34;collections&#34;&gt;Collections&lt;/h2&gt;
&lt;p&gt;When comparing collections, null collections are ordered last. Otherwise, collections are compared element by element until there is a mismatch, and then they are ordered based on the non-matching elements. If all elements are equal up to the length of the shorter one, then the shorter one is ordered first.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: Data type coercion operators (CAST)</title>
      <link>/en/sql-reference/language-elements/operators/data-type-coercion-operators-cast/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/language-elements/operators/data-type-coercion-operators-cast/</guid>
      <description>
        
        
        &lt;p&gt;Data type coercion (casting) passes an expression value to an input conversion routine for a specified data type, resulting in a constant of the indicated type. Data type coercion can be invoked by an explicit cast request that uses one of the following constructs:&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;SELECT CAST ( &lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt; AS &lt;span class=&#34;code-variable&#34;&gt;data-type&lt;/span&gt; )
SELECT &lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt;::&lt;span class=&#34;code-variable&#34;&gt;data-type&lt;/span&gt;
SELECT &lt;span class=&#34;code-variable&#34;&gt;data-type&lt;/span&gt; &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;string&lt;/span&gt;&amp;#39;
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;

&lt;table class=&#34;table table-bordered&#34; &gt;



&lt;tr&gt; 

&lt;td &gt;
&lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt;&lt;/td&gt; 

&lt;td &gt;


An expression of any type.&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;em&gt;&lt;code&gt;data-type&lt;/code&gt;&lt;/em&gt;&lt;/td&gt; 

&lt;td &gt;


An &lt;a href=&#34;../../../../en/sql-reference/data-types/&#34;&gt;SQL data type&lt;/a&gt; that OpenText™ Analytics Database supports to convert &lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt;.&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;h2 id=&#34;truncation&#34;&gt;Truncation&lt;/h2&gt;
&lt;p&gt;If a binary value is cast (implicitly or explicitly) to a binary type with a smaller length, the value is silently truncated. For example:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT &amp;#39;abcd&amp;#39;::BINARY(2);
 ?column?
----------
 ab
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Similarly, if a character value is cast (implicitly or explicitly) to a character value with a smaller length, the value is silently truncated. For example:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT &amp;#39;abcd&amp;#39;::CHAR(3);
 ?column?
----------
 abc
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;binary-casting-and-resizing&#34;&gt;Binary casting and resizing&lt;/h2&gt;
&lt;p&gt;OpenText™ Analytics Database supports only casts and resize operations as follows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;BINARY to and from VARBINARY&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;VARBINARY to and from LONG VARBINARY&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;BINARY to and from LONG VARBINARY&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;On binary data that contains a value with fewer bytes than the target column, values are right-extended with the zero byte &lt;code&gt;&#39;\0&#39;&lt;/code&gt; to the full width of the column. Trailing zeros on variable-length binary values are not right-extended:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT &amp;#39;ab&amp;#39;::BINARY(4), &amp;#39;ab&amp;#39;::VARBINARY(4), &amp;#39;ab&amp;#39;::LONG VARBINARY(4);
  ?column?  | ?column? | ?column?
------------+----------+----------
 ab\000\000 | ab       | ab
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;automatic-coercion&#34;&gt;Automatic coercion&lt;/h2&gt;
&lt;p&gt;The explicit type cast can be omitted if there is no ambiguity as to the type the constant must be. For example, when a constant is assigned directly to a column, it is automatically coerced to the column&#39;s data type.
&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT CAST((2 + 2) AS VARCHAR);
 ?column?
----------
 4
(1 row)

=&amp;gt; SELECT (2 + 2)::VARCHAR;
 ?column?
----------
 4
(1 row)

=&amp;gt; SELECT INTEGER &amp;#39;123&amp;#39;;
 ?column?
----------
      123
(1 row)

=&amp;gt; SELECT (2 + 2)::LONG VARCHAR
 ?column?
----------
 4
(1 row)

=&amp;gt; SELECT &amp;#39;2.2&amp;#39; + 2;
   ERROR:  invalid input syntax for integer: &amp;#34;2.2&amp;#34;

=&amp;gt; SELECT FLOAT &amp;#39;2.2&amp;#39; + 2;
 ?column?
----------
      4.2
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../en/sql-reference/data-types/data-type-coercion/&#34;&gt;Data Type Conversions&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../en/sql-reference/data-types/data-type-coercion-chart/&#34;&gt;Data Type Coercion Chart&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../en/sql-reference/language-elements/operators/data-type-coercion-operators-cast/cast-failures/&#34;&gt;CAST Failures&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: Date/time operators</title>
      <link>/en/sql-reference/language-elements/operators/datetime-operators/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/language-elements/operators/datetime-operators/</guid>
      <description>
        
        
        &lt;p&gt;OpenText™ Analytics Database supports the use of arithmetic operators on DATE/TIME operands:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;+&lt;/code&gt; (addition)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-&lt;/code&gt; (subtraction)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;*&lt;/code&gt; (multiplication)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/&lt;/code&gt; (division)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The operators described below that take &lt;code&gt;TIME&lt;/code&gt; or &lt;code&gt;TIMESTAMP&lt;/code&gt; input have two variants:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Operators that take &lt;code&gt;TIME WITH TIME ZONE&lt;/code&gt; or &lt;code&gt;TIMESTAMP WITH TIME ZONE&lt;/code&gt; input.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Operators that take &lt;code&gt;TIME WITHOUT TIME ZONE&lt;/code&gt; or &lt;code&gt;TIMESTAMP WITHOUT TIME ZONE&lt;/code&gt; input.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For brevity, these variants are not shown separately.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;+&lt;/code&gt; and &lt;code&gt;*&lt;/code&gt; operators come in commutative pairs—for example, both &lt;code&gt;DATE&lt;/code&gt; + &lt;code&gt;INTEGER&lt;/code&gt; and &lt;code&gt;INTEGER&lt;/code&gt; + &lt;code&gt;DATE&lt;/code&gt;. Only one of each pair is shown.

&lt;table class=&#34;table table-bordered&#34; &gt;



&lt;tr&gt; 

&lt;th &gt;
Example&lt;/th&gt; 

&lt;th &gt;
Result Type&lt;/th&gt; 

&lt;th &gt;
Result&lt;/th&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;DATE &#39;2001-09-28&#39; + INTEGER &#39;7&#39;&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;DATE&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;&#39;2001-10-05&#39;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;DATE &#39;2001-09-28&#39; + INTERVAL &#39;1 HOUR&#39;&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;TIMESTAMP&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;&#39;2001-09-28 01:00:00&#39;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;





&lt;pre class=&#34;table-pre&#34;&gt;DATE &#39;2001-09-28&#39; + TIME 
&#39;03:00&#39;&lt;/pre&gt;
&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;TIMESTAMP&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;&#39;2001-09-28 03:00:00&#39;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;





&lt;pre class=&#34;table-pre&#34;&gt;INTERVAL &#39;1 DAY&#39; + INTERVAL 
&#39;1 HOUR&#39;&lt;/pre&gt;
&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;INTERVAL&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;&#39;1 DAY 01:00:00&#39;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;





&lt;pre class=&#34;table-pre&#34;&gt;TIMESTAMP &#39;2001-09-28 01:00&#39; 
+ INTERVAL &#39;23 HOURS&#39;&lt;/pre&gt;
&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;TIMESTAMP&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;&#39;2001-09-29 00:00:00&#39;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;





&lt;pre class=&#34;table-pre&#34;&gt;TIME &#39;01:00&#39; + INTERVAL 
&#39;3 HOURS&#39;&lt;/pre&gt;
&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;TIME&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;&#39;04:00:00&#39;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;- INTERVAL &#39;23 HOURS&#39;&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;INTERVAL&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;&#39;-23:00:00&#39;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;





&lt;pre class=&#34;table-pre&#34;&gt;DATE &#39;2001-10-01&#39; – DATE 
&#39;2001-09-28&#39;&lt;/pre&gt;
&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;INTEGER&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;&#39;3&#39;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;DATE &#39;2001-10-01&#39; – INTEGER &#39;7&#39;&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;DATE&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;&#39;2001-09-24&#39;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;





&lt;pre class=&#34;table-pre&#34;&gt;DATE &#39;2001-09-28&#39; – INTERVAL 
&#39;1 HOUR&#39;&lt;/pre&gt;
&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;TIMESTAMP&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;&#39;2001-09-27 23:00:00&#39;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;TIME &#39;05:00&#39; – TIME &#39;03:00&#39;&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;INTERVAL&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;&#39;02:00:00&#39;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;





&lt;pre class=&#34;table-pre&#34;&gt;TIME &#39;05:00&#39;  INTERVAL 
&#39;2 HOURS&#39;&lt;/pre&gt;
&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;TIME&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;&#39;03:00:00&#39;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;





&lt;pre class=&#34;table-pre&#34;&gt;TIMESTAMP &#39;2001-09-28 23:00&#39; 
– INTERVAL &#39;23 HOURS&#39;&lt;/pre&gt;
&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;TIMESTAMP&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;&#39;2001-09-28 00:00:00&#39;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;





&lt;pre class=&#34;table-pre&#34;&gt;INTERVAL &#39;1 DAY&#39; – INTERVAL 
&#39;1 HOUR&#39;&lt;/pre&gt;
&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;INTERVAL&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;&#39;1 DAY -01:00:00&#39;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;





&lt;pre class=&#34;table-pre&#34;&gt;TIMESTAMP &#39;2001-09-29 03:00&#39; 
– TIMESTAMP &#39;2001-09-27 12:00&#39;&lt;/pre&gt;
&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;INTERVAL&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;&#39;1 DAY 15:00:00&#39;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;900 * INTERVAL &#39;1 SECOND&#39;&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;INTERVAL&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;&#39;00:15:00&#39;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;21 * INTERVAL &#39;1 DAY&#39;&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;INTERVAL&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;&#39;21 DAYS&#39;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;






&lt;pre class=&#34;table-pre&#34;&gt;DOUBLE PRECISION &#39;3.5&#39; 
* INTERVAL &#39;1 HOUR&#39; 
&lt;/pre&gt;
&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;INTERVAL&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;&#39;03:30:00&#39;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;





&lt;pre class=&#34;table-pre&#34;&gt;INTERVAL &#39;1 HOUR&#39; / 
DOUBLE PRECISION &#39;1.5&#39;&lt;/pre&gt;
&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;INTERVAL&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;&#39;00:40:00&#39;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: Mathematical operators</title>
      <link>/en/sql-reference/language-elements/operators/mathematical-operators/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/language-elements/operators/mathematical-operators/</guid>
      <description>
        
        
        &lt;p&gt;Mathematical operators are provided for many data types.&lt;/p&gt;

&lt;table class=&#34;table table-bordered&#34; &gt;



&lt;tr&gt; 

&lt;th &gt;
Operator&lt;/th&gt; 

&lt;th &gt;
Description&lt;/th&gt; 

&lt;th &gt;
Example&lt;/th&gt; 

&lt;th &gt;
Result&lt;/th&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;!&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


Factorial&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;5 !&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;120&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;+&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


Addition&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;2 + 3&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;5&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;–&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


Subtraction&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;2 – 3&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;–1&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;*&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


Multiplication&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;2 * 3&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;6&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;/&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


Division (integer division produces NUMERIC results).&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;4 / 2&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;2.00...&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;//&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


With integer division, returns an INTEGER rather than a NUMERIC.&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;117.32 // 2.5&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;46&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;%&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;



Modulo (remainder). For details, see
&lt;code&gt;&lt;a href=&#34;../../../../en/sql-reference/functions/mathematical-functions/mod/#&#34;&gt;MOD&lt;/a&gt;&lt;/code&gt;.&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;5 % 4&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;^&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


Exponentiation&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;2.0 ^ 3.0&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;8&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;|/&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


Square root&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;|/ 25.0&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;5&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;||/&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


Cube root&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;||/ 27.0&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;!!&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


Factorial (prefix operator)&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;!! 5&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;120&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;@&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


Absolute value&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;@ -5.0&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;5&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;h2 id=&#34;factorial-operator-support&#34;&gt;Factorial operator support&lt;/h2&gt;
&lt;p&gt;OpenText™ Analytics Database supports use of factorial operators on positive and negative floating point (&lt;a href=&#34;../../../../en/sql-reference/data-types/numeric-data-types/double-precision-float/&#34;&gt;&lt;code&gt;DOUBLE PRECISION&lt;/code&gt;&lt;/a&gt;) numbers and integers. For example:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT 4.98!;
   ?column?
------------------
 115.978600750905
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Factorial is defined in terms of the gamma function, where (-1) = Infinity and the other negative integers are undefined. For example:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;(–4)! = NaN
–(4!) = –24
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Factorial is defined as follows for all complex numbers &lt;em&gt;&lt;code&gt;z&lt;/code&gt;&lt;/em&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;z&lt;/span&gt;! = gamma(&lt;span class=&#34;code-variable&#34;&gt;z&lt;/span&gt;+1)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;For details, see &lt;a href=&#34;http://people.math.sfu.ca/~cbm/aands/page_255.htm&#34;&gt;Abramowitz and Stegun: Handbook of Mathematical Functions&lt;/a&gt;.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: NULL operators</title>
      <link>/en/sql-reference/language-elements/operators/null-operators/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/language-elements/operators/null-operators/</guid>
      <description>
        
        
        &lt;p&gt;To check whether a value is or is not NULL, use the following equivalent constructs:&lt;/p&gt;
&lt;p&gt;Standard:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[expression IS NULL | expression IS NOT NULL]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Non-standard:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[expression ISNULL | expression NOTNULL]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Do not write &lt;em&gt;&lt;code&gt;expression &lt;/code&gt;&lt;/em&gt;&lt;code&gt;= NULL&lt;/code&gt;: NULL represents an unknown value, and two unknown values are not necessarily equal. This behavior conforms to the SQL standard.

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

Some applications might expect that &lt;em&gt;&lt;code&gt;expression &lt;/code&gt;&lt;/em&gt;&lt;code&gt;= NULL&lt;/code&gt; returns true if &lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt; evaluates to NULL. In this case, modify the application to comply with the SQL standard.

&lt;/div&gt;&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: String concatenation operators</title>
      <link>/en/sql-reference/language-elements/operators/string-concatenation-operators/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/language-elements/operators/string-concatenation-operators/</guid>
      <description>
        
        
        &lt;p&gt;To concatenate two strings on a single line, use the concatenation operator (two consecutive vertical bars).&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;string&lt;/span&gt; || &lt;span class=&#34;code-variable&#34;&gt;string&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;

&lt;table class=&#34;table table-bordered&#34; &gt;



&lt;tr&gt; 

&lt;td &gt;



&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;string&lt;/span&gt;&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


Expression of type &lt;code&gt;CHAR&lt;/code&gt; or &lt;code&gt;VARCHAR&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;h2 id=&#34;notes&#34;&gt;Notes&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;|| is used to concatenate expressions and constants. The expressions are cast to &lt;code&gt;VARCHAR&lt;/code&gt; if possible, otherwise to &lt;code&gt;VARBINARY&lt;/code&gt;, and must both be one or the other.&lt;/li&gt;
&lt;li&gt;Two consecutive strings within a single SQL statement on separate lines are automatically concatenated&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following example is a single string written on two lines:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT E&amp;#39;xx&amp;#39;-&amp;gt; &amp;#39;\\&amp;#39;;
 ?column?
----------
 xx\
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The following examples show two strings concatenated:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT E&amp;#39;xx&amp;#39; ||-&amp;gt; &amp;#39;\\&amp;#39;;
 ?column?
----------
 xx\\
(1 row)

=&amp;gt; SELECT &amp;#39;auto&amp;#39; || &amp;#39;mobile&amp;#39;;
 ?column?
----------
 automobile
(1 row)

=&amp;gt; SELECT &amp;#39;auto&amp;#39;-&amp;gt; &amp;#39;mobile&amp;#39;;
 ?column?
----------
 automobile
(1 row)

=&amp;gt; SELECT 1 || 2;
 ?column?
----------
 12
(1 row)


=&amp;gt; SELECT &amp;#39;1&amp;#39; || &amp;#39;2&amp;#39;;
 ?column?
----------
 12
(1 row)
=&amp;gt; SELECT &amp;#39;1&amp;#39;-&amp;gt; &amp;#39;2&amp;#39;;
 ?column?
----------
 12
(1 row)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
  </channel>
</rss>
