NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
E-23
Expressions
The following examples show three different ways to request an EXPLAIN report
for a query that uses multiple lines in SQLCI:
Example 1. >>EXPLAIN SELECT U1,U2, MIN(U3), MAX(U3)
+>FROM \SYS.$VOL.CAT.T
+>GROUP BY 1 , 2;
Example 2. >>EXPLAIN " SELECT U1,U2, MIN(U3), MAX(U3) "
+>&" FROM \SYS.$VOL.CAT.T "
+>&" GROUP BY 1 , 2";
Example 3. >>PREPARE SAVQ FROM SELECT U1,U2, MIN(U3),
MAX(U3)
+>FROM \SYS.$VOL.CAT.T
+>GROUP BY 1 , 2;
..
--- SQL command prepared.
>> EXPLAIN SAVQ;
For examples of EXPLAIN reports, see the NonStop SQL/MP Query Guide. For an
example of a DEFINE report (an optional portion of an EXPLAIN report that
describes the DEFINEs used in SQL statements within a program) see the NonStop
SQL/MP programming manual for your host language.
Expressions
An expression specifies a value. An expression can be a simple character string, a
numeric literal, a column name, or a condition (CASE expression) that specifies the
value of the column in a row of a table. An expression can also include function calls
and arithmetic operators. All of the following are simple expressions:
An expression can have a character, numeric, date-time, or INTERVAL data type. The
data type of an expression is the data type of the value of the expression.
The remainder of this entry discusses numeric, date-time, and INTERVAL expressions.
For more detail about character expressions, see Character Expressions
on page C-11.
For more information about conditional expressions, see CASE Expression on page C-1.
ABILENE” A character string
-57 A numeric literal
CUSTNAME The value in column CUSTNAME
COUNT (DISTINCT CITY) The COUNT function applied to the values in column CITY