<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>OpenText Analytics Database 26.2.x – Language elements</title>
    <link>/en/sql-reference/language-elements/</link>
    <description>Recent content in Language elements on OpenText Analytics Database 26.2.x</description>
    <generator>Hugo -- gohugo.io</generator>
    
	  <atom:link href="/en/sql-reference/language-elements/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Sql-Reference: Keywords</title>
      <link>/en/sql-reference/language-elements/keywords/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/language-elements/keywords/</guid>
      <description>
        
        
        &lt;p&gt;Keywords are words that have a specific meaning in the SQL language. Every SQL statement contains one or more keywords. Although SQL is not case-sensitive with respect to keywords, they are generally shown in uppercase letters throughout this documentation for readability purposes.

&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;

If you use a keyword as the name of an identifier or an alias in your SQL statements, you may have to qualify the keyword with &lt;code&gt;AS&lt;/code&gt; or double-quotes. OpenText™ Analytics Database requires &lt;code&gt;AS&lt;/code&gt; or double-quotes for certain reserved and non-reserved words to prevent confusion with expression syntax, or where the use of a word would be ambiguous.

&lt;/div&gt;&lt;/p&gt;
&lt;h2 id=&#34;reserved-words-and-keywords&#34;&gt;Reserved words and keywords&lt;/h2&gt;
&lt;p&gt;Many keywords are also reserved words.&lt;/p&gt;
&lt;p&gt;OpenText recommends that you do not use reserved words as names for objects or as identifiers, as including reserved words can make your SQL statements confusing. Reserved words that are used as names for objects or identifiers must be enclosed in double-quotes.

&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;

All reserved words are also keywords, but the database can add reserved words that are not keywords. A reserved word can simply be a word that is reserved for future use.

&lt;/div&gt;&lt;/p&gt;
&lt;h2 id=&#34;non-reserved-keywords&#34;&gt;Non-reserved keywords&lt;/h2&gt;
&lt;p&gt;Non-reserved keywords have a special meaning in some contexts, but can be used as identifiers in others. You can use non-reserved keywords as aliases—for example, &lt;code&gt;SOURCE&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT my_node AS SOURCE FROM nodes;
&lt;/code&gt;&lt;/pre&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;The database uses several non-reserved keywords in &lt;a href=&#34;../../../en/admin/managing-queries/directed-queries/&#34;&gt;directed queries&lt;/a&gt; to specify special join types. You can use these keywords as table aliases only if they are double-quoted; otherwise, double-quotes can be omitted:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;ANTI&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;NULLAWARE&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;SEMI&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;SEMIALL&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;UNI&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/div&gt;
&lt;h2 id=&#34;viewing-the-list-of-reserved-and-non-reserved-keywords&#34;&gt;Viewing the list of reserved and non-reserved keywords&lt;/h2&gt;
&lt;p&gt;To view the current list of reserved and non-reserved words, query system table 
&lt;code&gt;&lt;a href=&#34;../../../en/sql-reference/system-tables/v-catalog-schema/keywords/#&#34;&gt;KEYWORDS&lt;/a&gt;&lt;/code&gt;. The database lists keywords alphabetically and identifies them as reserved (R) or non-reserved (N).&lt;/p&gt;
&lt;p&gt;For example, the following query returns all reserved keywords that begin with the letter B:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT * FROM keywords WHERE reserved = &amp;#39;R&amp;#39; AND keyword ilike &amp;#39;B%&amp;#39;;
 keyword | reserved
---------+----------
 BETWEEN | R
 BIGINT  | R
 BINARY  | R
 BIT     | R
 BOOLEAN | R
 BOTH    | R
(6 rows)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: Identifiers</title>
      <link>/en/sql-reference/language-elements/identifiers/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/language-elements/identifiers/</guid>
      <description>
        
        
        &lt;p&gt;Identifiers (names) of objects such as schema, table, projection, column names, and so on, can be up to 128 bytes in length.&lt;/p&gt;
&lt;h2 id=&#34;unquoted-identifiers&#34;&gt;Unquoted identifiers&lt;/h2&gt;
&lt;p&gt;Unquoted SQL identifiers must begin with one of the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Non-Unicode letters: A–Z or a-z&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Underscore (_)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Subsequent characters in an identifier can be any combination of the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Non-Unicode letters: A–Z or a-z&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Underscore (_)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Digits(0–9)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Unicode letters (letters with diacriticals or not in the Latin alphabet), unsupported for model names&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Dollar sign (&lt;code&gt;$&lt;/code&gt;), unsupported for model names&lt;/p&gt;

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

The SQL standard does not support dollar sign in identifiers, so usage can cause application portability problems.

&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;quoted-identifiers&#34;&gt;Quoted identifiers&lt;/h2&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;

Quoted identifiers are not supported for model names.

&lt;/div&gt;
&lt;p&gt;Identifiers enclosed in double quote (&lt;code&gt;&amp;quot;&lt;/code&gt;) characters can contain any character. If you want to include a double quote, you need a pair of them; for example &lt;code&gt;&amp;quot;&amp;quot;&amp;quot;&amp;quot;&lt;/code&gt;. You can use names that would otherwise be invalid—for example, names that include only numeric characters (&lt;code&gt;&amp;quot;123&amp;quot;&lt;/code&gt;) or contain space characters, punctuation marks, and SQL or &lt;a href=&#34;../../../en/sql-reference/language-elements/keywords/&#34;&gt;reserved keywords&lt;/a&gt;. For example:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;CREATE SEQUENCE &amp;#34;my sequence!&amp;#34;;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Double quotes are required for non-alphanumerics and SQL keywords such as &amp;quot;1time&amp;quot;, &amp;quot;Next week&amp;quot; and &amp;quot;Select&amp;quot;.&lt;/p&gt;
&lt;h2 id=&#34;case-sensitivity&#34;&gt;Case sensitivity&lt;/h2&gt;
&lt;p&gt;Identifiers are not case-sensitive. Thus, identifiers &lt;code&gt;&amp;quot;ABC&amp;quot;&lt;/code&gt;, &lt;code&gt;&amp;quot;ABc&amp;quot;&lt;/code&gt;, and &lt;code&gt;&amp;quot;aBc&amp;quot;&lt;/code&gt; are synonymous, as are &lt;code&gt;ABC&lt;/code&gt;, &lt;code&gt;ABc&lt;/code&gt;, and &lt;code&gt;aBc.&lt;/code&gt;&lt;/p&gt;
&lt;h2 id=&#34;non-ascii-characters&#34;&gt;Non-ASCII characters&lt;/h2&gt;
&lt;p&gt;OpenText™ Analytics Database accepts non-ASCII UTF-8 Unicode characters for table names, column names, and other identifiers, extending the cases where upper/lower case distinctions are ignored (case-folded) to all alphabets, including Latin, Cyrillic, and Greek.&lt;/p&gt;
&lt;p&gt;For example, the following &lt;code&gt;CREATE TABLE&lt;/code&gt; statement uses the ß (German eszett) in the table name:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE TABLE straße(x int, y int);
   CREATE TABLE
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;identifiers-are-stored-as-created&#34;&gt;Identifiers are stored as created&lt;/h2&gt;
&lt;p&gt;SQL identifiers, such as table and column names, are not converted to lowercase. They are stored as created, and references to them are resolved using case-insensitive compares. For example, the following statement creates table &lt;code&gt;ALLCAPS&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE TABLE ALLCAPS(c1 varchar(30));
=&amp;gt; INSERT INTO ALLCAPS values(&amp;#39;upper case&amp;#39;);
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The following statements are variations of the same query:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT * FROM ALLCAPS;
=&amp;gt; SELECT * FROM allcaps;
=&amp;gt; SELECT * FROM &amp;#34;allcaps&amp;#34;;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The three queries all return the same result:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;     c1
------------
 upper case
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Note that the database returns an error if you try to create the table &lt;code&gt;AllCaps&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE TABLE AllCaps(c1 varchar(30));
   ROLLBACK:  table &amp;#34;AllCaps&amp;#34; already exists
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;See &lt;a href=&#34;../../../en/sql-reference/functions/data-type-specific-functions/string-functions/quote-ident/#&#34;&gt;QUOTE_IDENT&lt;/a&gt; for additional information.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: Literals</title>
      <link>/en/sql-reference/language-elements/literals/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/language-elements/literals/</guid>
      <description>
        
        
        &lt;p&gt;Literals are numbers or strings used in SQL as constants. Literals are included in the select-list, along with expressions and built-in functions and can also be constants.&lt;/p&gt;
&lt;p&gt;OpenText™ Analytics Database provides support for number-type literals (integers and numerics), string literals, VARBINARY string literals, and date/time literals. The various string literal formats are discussed in this section.
&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: Operators</title>
      <link>/en/sql-reference/language-elements/operators/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/language-elements/operators/</guid>
      <description>
        
        
        &lt;p&gt;Operators are logical, mathematical, and equality symbols used in SQL to evaluate, compare, or calculate values.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: Expressions</title>
      <link>/en/sql-reference/language-elements/expressions/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/language-elements/expressions/</guid>
      <description>
        
        
        &lt;p&gt;SQL expressions are the components of a query that compare a value or values against other values. They can also perform calculations. An expression found inside a SQL statement is usually in the form of a conditional statement.&lt;/p&gt;
&lt;p&gt;Some functions also use &lt;a href=&#34;../../../en/sql-reference/language-elements/lambda-functions/#&#34;&gt;Lambda functions&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;operator-precedence&#34;&gt;Operator precedence&lt;/h2&gt;
&lt;p&gt;The following table shows operator precedence in decreasing (high to low) order.&lt;/p&gt;
&lt;p&gt;When an expression includes more than one operator, specify the order of operation using parentheses, rather than relying on operator precedence.&lt;/p&gt;

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



&lt;tr&gt; 

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

&lt;th &gt;
Associativity&lt;/th&gt; 

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

&lt;tr&gt; 

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

&lt;td &gt;


left&lt;/td&gt; 

&lt;td &gt;


table/column name separator&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

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

&lt;td &gt;


left&lt;/td&gt; 

&lt;td &gt;


typecast&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;code&gt;[ ]&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


left&lt;/td&gt; 

&lt;td &gt;


array element selection&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

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

&lt;td &gt;


right&lt;/td&gt; 

&lt;td &gt;


unary minus&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

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

&lt;td &gt;


left&lt;/td&gt; 

&lt;td &gt;


exponentiation&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

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

&lt;td &gt;


left&lt;/td&gt; 

&lt;td &gt;


multiplication, division, modulo&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

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

&lt;td &gt;


left&lt;/td&gt; 

&lt;td &gt;


addition, subtraction&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

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

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

&lt;td &gt;


IS TRUE, IS FALSE, IS UNKNOWN, IS NULL&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

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

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

&lt;td &gt;


set membership&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

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

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

&lt;td &gt;


range containment&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

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

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

&lt;td &gt;


time interval overlap&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

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

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

&lt;td &gt;


string pattern matching&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

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

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

&lt;td &gt;


less than, greater than&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

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

&lt;td &gt;


right&lt;/td&gt; 

&lt;td &gt;


equality, assignment&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

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

&lt;td &gt;


right&lt;/td&gt; 

&lt;td &gt;


logical negation&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

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

&lt;td &gt;


left&lt;/td&gt; 

&lt;td &gt;


logical conjunction&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

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

&lt;td &gt;


left&lt;/td&gt; 

&lt;td &gt;


logical disjunction&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;h2 id=&#34;expression-evaluation-rules&#34;&gt;Expression evaluation rules&lt;/h2&gt;
&lt;p&gt;The order of evaluation of subexpressions is not defined. In particular, the inputs of an operator or function are not necessarily evaluated left-to-right or in any other fixed order. To force evaluation in a specific order, use a &lt;a href=&#34;../../../en/sql-reference/language-elements/expressions/case-expressions/&#34;&gt;CASE&lt;/a&gt; construct. For example, the following is an untrustworthy way of trying to avoid division by zero in a WHERE clause:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT x, y WHERE x &amp;lt;&amp;gt; 0 AND y/x &amp;gt; 1.5; --- unsafe
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The following example, however, is safe:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT x, y
   WHERE
     CASE
       WHEN x &amp;lt;&amp;gt; 0 THEN y/x &amp;gt; 1.5
       ELSE false
     END;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;A CASE construct used in this fashion defeats optimization attempts, so use it only when necessary. In this particular example, it would be best to avoid the issue by writing &lt;code&gt;y &amp;gt; 1.5*x&lt;/code&gt; instead.&lt;/p&gt;
&lt;h2 id=&#34;limits-to-sql-expressions&#34;&gt;Limits to SQL expressions&lt;/h2&gt;
&lt;p&gt;Expressions are limited by the available stack. OpenText™ Analytics Database requires at least 100KB of free stack. If this limit is exceeded then the error &amp;quot;The query contains an expression that is too complex to analyze&amp;quot; can be returned. Adding physical memory and/or increasing the value of &lt;code&gt;ulimit -s&lt;/code&gt; can increase the available stack and prevent the error.&lt;/p&gt;
&lt;p&gt;Analytic expressions have a maximum recursion depth of 2000. If this limit is exceeded, the error &amp;quot;The query contains an expression that is too complex to analyze&amp;quot; can be returned. The recursion depth limit cannot be increased.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: Lambda functions</title>
      <link>/en/sql-reference/language-elements/lambda-functions/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/language-elements/lambda-functions/</guid>
      <description>
        
        
        &lt;p&gt;Some SQL functions have arguments that are lambda functions. A lambda function is an unnamed inline function that is evaluated by the containing SQL function and returns a value.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;p&gt;Lambda with one argument:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;argument&lt;/span&gt; -&amp;gt; &lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Lambda with more than one argument:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;(&lt;span class=&#34;code-variable&#34;&gt;argument&lt;/span&gt;, ...) -&amp;gt; &lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;

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



&lt;tr&gt; 

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

&lt;td &gt;
Name to use for an input value for the expression. The name cannot be a reserved keyword, the name of an argument to a parent or nested lambda, or a column name or alias.&lt;/td&gt;&lt;/tr&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;
Expression that uses the input arguments and returns a result to the containing SQL function. See the documentation of individual SQL functions for restrictions on return values. For example, some functions require a Boolean result.&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The &lt;a href=&#34;../../../en/sql-reference/functions/data-type-specific-functions/collection-functions/array-find/#&#34;&gt;ARRAY_FIND&lt;/a&gt; function returns the first index that matches the element being searched for. Instead of a literal element, you can write a lambda function that returns a Boolean. The lambda function is applied to each element in the array until a match is found or all elements have been tested. In the following example, each person in the table has an array of email addresses, and the function locates fake addresses:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE TABLE people (id INT, name VARCHAR, email ARRAY[VARCHAR,5]);

=&amp;gt; SELECT name, ARRAY_FIND(email, e -&amp;gt; REGEXP_LIKE(e,&amp;#39;example.com&amp;#39;,&amp;#39;i&amp;#39;))
   AS &amp;#39;example.com&amp;#39;
   FROM people;
     name      | example.com
---------------+-------------
 Alice Adams   |           1
 Bob Adams     |           1
 Carol Collins |           0
 Dave Jones    |           0
(4 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The argument &lt;code&gt;e&lt;/code&gt; represents the individual element, and the body of the lambda expression is the regular-expression comparison. The input table has four rows; in each row, the lambda function is called once per array element.&lt;/p&gt;
&lt;p&gt;In the following example, a schedules table includes an array of events, where each event is a ROW with several fields:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE TABLE schedules
       (guest VARCHAR,
       events ARRAY[ROW(e_date DATE, e_name VARCHAR, price NUMERIC(8,2))]);
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can use the &lt;a href=&#34;../../../en/sql-reference/functions/data-type-specific-functions/collection-functions/contains/#&#34;&gt;CONTAINS&lt;/a&gt; function with a lambda expression to find people who have more than one event on the same day. The second argument, &lt;code&gt;idx&lt;/code&gt;, is the index of the current element:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT guest FROM schedules
WHERE CONTAINS(events, (e, idx) -&amp;gt;
                       (idx &amp;lt; ARRAY_LENGTH(events) - 1)
                       AND (e.e_date = events[idx + 1].e_date));
    guest
-------------
 Alice Adams
(1 row)
&lt;/code&gt;&lt;/pre&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: Predicates</title>
      <link>/en/sql-reference/language-elements/predicates/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/language-elements/predicates/</guid>
      <description>
        
        
        &lt;p&gt;Predicates are truth-tests. If the predicate test is true, it returns a value. Each predicate is evaluated per row, so that when the predicate is part of an entire table SELECT statement, the statement can return multiple results.&lt;/p&gt;
&lt;p&gt;Predicates consist of a set of parameters and arguments. For example, in the following WHERE clause:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;WHERE name = &amp;#39;Smith&amp;#39;
&lt;/code&gt;&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;name = &#39;Smith&#39;&lt;/code&gt; is the predicate&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;&#39;Smith&#39;&lt;/code&gt; is an expression&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: Hints</title>
      <link>/en/sql-reference/language-elements/hints/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/language-elements/hints/</guid>
      <description>
        
        
        &lt;p&gt;Hints are directives that you embed within a query or &lt;a class=&#34;glosslink&#34; href=&#34;../../../en/glossary/directed-query/&#34; title=&#34;A saved set of instructions that direct the optimizer to generate a query plan for a given query.&#34;&gt;directed query&lt;/a&gt;. They conform to the following syntax:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;/*+&lt;span class=&#34;code-variable&#34;&gt;hint-name&lt;/span&gt;[, &lt;span class=&#34;code-variable&#34;&gt;hint-name&lt;/span&gt;]...*/
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Hints are bracketed by comment characters &lt;code&gt;/*+&lt;/code&gt; and &lt;code&gt;*/&lt;/code&gt;, which can enclose multiple comma-delimited hints. For example:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;SELECT /*+syntactic_join,verbatim*/
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;restrictions&#34;&gt;Restrictions&lt;/h2&gt;
&lt;p&gt;When embedding hints in a query, be aware of the following restrictions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Do not embed spaces in the comment characters &lt;code&gt;/*&lt;/code&gt; and &lt;code&gt;*/&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In general, spaces are allowed before and after the plus (&lt;code&gt;+&lt;/code&gt;) character and &lt;em&gt;&lt;code&gt;hint-name&lt;/code&gt;&lt;/em&gt;; however, some third-party tools do not support spaces embedded inside &lt;code&gt;/*&lt;/code&gt;+.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;supported-hints&#34;&gt;Supported hints&lt;/h2&gt;
&lt;p&gt;OpenText™ Analytics Database supports the following hints:&lt;/p&gt;
&lt;h3 id=&#34;general-hints&#34;&gt;General hints&lt;/h3&gt;

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



&lt;tr&gt; 

&lt;th &gt;
Hint&lt;/th&gt; 

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

&lt;tr&gt; 

&lt;td &gt;
&lt;a href=&#34;../../../en/sql-reference/language-elements/hints/allnodes/#&#34;&gt;ALLNODES&lt;/a&gt;&lt;/td&gt; 

&lt;td &gt;
Qualifies an &lt;a href=&#34;../../../en/sql-reference/statements/explain/#&#34;&gt;EXPLAIN&lt;/a&gt; statement to request a query plan that assumes all nodes are active.&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;a href=&#34;../../../en/sql-reference/language-elements/hints/early-materialization/#&#34;&gt;EARLY_MATERIALIZATION&lt;/a&gt;&lt;/td&gt; 

&lt;td &gt;
Specifies early materialization of a table for the current query.&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;a href=&#34;../../../en/sql-reference/language-elements/hints/enable-with-clause-materialization/#&#34;&gt;ENABLE_WITH_CLAUSE_MATERIALIZATION&lt;/a&gt;&lt;/td&gt; 

&lt;td &gt;
Enables and disables &lt;a href=&#34;../../../en/sql-reference/statements/select/with-clause/&#34;&gt;WITH clause&lt;/a&gt; materialization for a specific query.&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;a href=&#34;../../../en/sql-reference/language-elements/hints/label/#&#34;&gt;LABEL&lt;/a&gt;&lt;/td&gt; 

&lt;td &gt;
Labels a query so you can identify it for profiling and debugging.&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;a href=&#34;../../../en/sql-reference/language-elements/hints/skip-statistics/#&#34;&gt;SKIP_STATISTICS&lt;/a&gt;&lt;/td&gt; 

&lt;td &gt;
Directs the optimizer to produce a query plan that incorporates only minimal statistics.&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;h3 id=&#34;eon-mode-hints&#34;&gt;Eon Mode hints&lt;/h3&gt;

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



&lt;tr&gt; 

&lt;th &gt;
Hint&lt;/th&gt; 

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

&lt;tr&gt; 

&lt;td &gt;
&lt;a href=&#34;../../../en/sql-reference/language-elements/hints/depot-fetch/#&#34;&gt;DEPOT_FETCH&lt;/a&gt;&lt;/td&gt; 

&lt;td &gt;
Specifies whether a query fetches data to the depot from communal storage when the depot lacks data for this query.&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;a href=&#34;../../../en/sql-reference/language-elements/hints/ecsmode/#&#34;&gt;ECSMODE&lt;/a&gt;&lt;/td&gt; 

&lt;td &gt;
Specifies the &lt;a href=&#34;../../../en/eon/scaling-your-eon-db/manually-choosing-an-ecs-strategy/&#34;&gt;elastic crunch scaling (ECS) strategy&lt;/a&gt; for dividing shard data among its subscribers.&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;h3 id=&#34;join-hints&#34;&gt;Join hints&lt;/h3&gt;

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



&lt;tr&gt; 

&lt;th &gt;
Hint&lt;/th&gt; 

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

&lt;tr&gt; 

&lt;td &gt;
&lt;a href=&#34;../../../en/sql-reference/language-elements/hints/syntactic-join/#&#34;&gt;SYNTACTIC_JOIN&lt;/a&gt;&lt;/td&gt; 

&lt;td &gt;
Enforces join order and enables other join hints.&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;a href=&#34;../../../en/sql-reference/language-elements/hints/distrib/#&#34;&gt;DISTRIB&lt;/a&gt;&lt;/td&gt; 

&lt;td &gt;
Sets the input operations for a distributed join to broadcast, resegment, local, or filter.&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;a href=&#34;../../../en/sql-reference/language-elements/hints/gbytype/#&#34;&gt;GBYTYPE&lt;/a&gt;&lt;/td&gt; 

&lt;td &gt;
Specifies which algorithm—GROUPBY HASH or GROUPBY PIPELINED—the query optimizer should use to implement a &lt;a href=&#34;../../../en/sql-reference/statements/select/group-by-clause/&#34;&gt;GROUP BY&lt;/a&gt; clause.&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;a href=&#34;../../../en/sql-reference/language-elements/hints/jtype/#&#34;&gt;JTYPE&lt;/a&gt;&lt;/td&gt; 

&lt;td &gt;
Enforces the join type: merge or hash join.&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;a href=&#34;../../../en/sql-reference/language-elements/hints/utype/#&#34;&gt;UTYPE&lt;/a&gt;&lt;/td&gt; 

&lt;td &gt;
Specifies how to combine UNION ALL input.&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;&lt;a name=&#34;TableHints&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3 id=&#34;projection-hints&#34;&gt;Projection hints&lt;/h3&gt;

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



&lt;tr&gt; 

&lt;th &gt;
Hint&lt;/th&gt; 

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

&lt;tr&gt; 

&lt;td &gt;
&lt;a href=&#34;../../../en/sql-reference/language-elements/hints/projs/#&#34;&gt;PROJS&lt;/a&gt;&lt;/td&gt; 

&lt;td &gt;
Specifies one or more projections to use for a queried table.&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;a href=&#34;../../../en/sql-reference/language-elements/hints/skip-projs/#&#34;&gt;SKIP_PROJS&lt;/a&gt;&lt;/td&gt; 

&lt;td &gt;
Specifies which projections to avoid using for a queried table.&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;h3 id=&#34;directed-query-hints&#34;&gt;Directed query hints&lt;/h3&gt;
&lt;p&gt;The following hints are only supported by directed queries:

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



&lt;tr&gt; 

&lt;th &gt;
Hint&lt;/th&gt; 

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

&lt;tr&gt; 

&lt;td &gt;
&lt;a href=&#34;../../../en/sql-reference/language-elements/hints/c/#&#34;&gt;:c&lt;/a&gt;&lt;/td&gt; 

&lt;td &gt;
Marks a query constant that must be included in an input query; otherwise, that input query is disqualified from using the directed query.&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;a href=&#34;../../../en/sql-reference/language-elements/hints/v/#&#34;&gt;:v&lt;/a&gt;&lt;/td&gt; 

&lt;td &gt;
Maps an input query constant to one or more annotated query constants.&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;a href=&#34;../../../en/sql-reference/language-elements/hints/verbatim/#&#34;&gt;VERBATIM&lt;/a&gt;&lt;/td&gt; 

&lt;td &gt;
Enforces execution of an annotated query exactly as written.&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: Window clauses</title>
      <link>/en/sql-reference/language-elements/window-clauses/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/language-elements/window-clauses/</guid>
      <description>
        
        
        &lt;p&gt;When used with an &lt;a href=&#34;../../../en/data-analysis/sql-analytics/invoking-analytic-functions/&#34;&gt;analytic function&lt;/a&gt;, window clauses specify how to partition and sort function input, as well as how to frame input with respect to the current row. When used with a single-phase transform function, the PARTITION ROW and PARTITION LEFT JOIN window clauses support single-row partitions for single-phase transform functions, rather than analytic functions.&lt;/p&gt;

      </description>
    </item>
    
  </channel>
</rss>
