anchor.diff:  <<<
   [[select_examples]]
   === Examples of SELECT
  +
  +* The following example defines two CTEs, w1 and w2. w2 references w1 which is defined before w2.
  +```
  +>>select * from t1
  +
  + C1 C2
  + ----------
  +
  +  1 1
  +  2 2
  +  3 3
  +  4 4
  +  5 5
  +
  + --- SQL operation complete.
  +
  +>>with w1 as (select * from t1),
  +>>w2 as (select * from w1)
  +>>select * from w2;
  +
  + C1 C2
  + ----------
  +
  +  1 1
  +  2 2
  +  3 3
  +  4 4
  +  5 5
  +
  + --- SQL operation complete.
  +```
  +
  +* The following example defines two CTEs, w1 and w2, and then perform a JOIN between them.
  +```
  +>>select * from t1
  +
  + C1 C2
  + ----------
  +
  +  1 1
  +  2 2
  +  3 3
  +  4 4
  +  5 5
  +
  + --- SQL operation complete.
  +
  +>>select * from t2
  +
  + C1 C2
  + ----------
  +
  +  3 3
  +  4 4
  +  5 5
  +  6 6
  +  7 7
  +
  + --- SQL operation complete.
  +
  +>>with w1 as (select c1, c2 from t1),
  +>>w2 as (select c1, c2 from t2)
  +>>select * from w1, w2 where w1.c1 = w2.c1;
  +
  + C1 C2 C1 C2
  + ----------
  +
  +  3 3 3 3
  +  4 4 4 4
  +  5 5 5 5
  +
  + --- SQL operation complete.
  +```
   
   * Retrieve information from the EMPLOYEE table for employees with a job code greater than 500 and who are in departments
   with numbers less than or equal to 3000, displaying the results in ascending order by job code:
  
positive.code: ```
  SELECT sum(distinct a), avg(distinct b), sum(c) from T group by d;
  ```
  
  [[select_considerations_for_select_list]]
  ==== Considerations for Select List
  
negative.code: [[select_syntax]]
  === Syntax Description of SELECT
  
  * with-clause
  
  +
  With-clause, known as Common Table Expressions (CTEs) or subquery factoring clause, was introduced in the SQL-99 standard and has been implemented into Trafodion R2.1.
  
  +
  The with-clause assigns an alias to a complex expression. The alias is treated like a temporary table or an inline view that lasts only for the duration of the query and can be referenced multiple times in the same query.
  
  +
  By abstracting the complicated parts of the query into simpler, separate and logical blocks, and possibly materializing the results of these parts to avoid recomputing it multiple times, the with-clause has following advantages:
  
  ** Simplifies complicated queries, increasing readability and reducing repeated references.
  ** Builds reusable units and decreases maintenance cost.
  ** Shortens response time and enhances performance of the query.
  ** Improves  compatibility with other systems which support with-clause as well.
  
  * cte-table-name
  +
  specifies the unique name of the CTE to be created, which is a valid SQL identifier with a maximum of 128 characters. Duplicate names are not allowed in a single with-clause.
  
  * `"[" ANY _N_ "]" | "[" FIRST _N_ "]"`
  +
  specifies that _N_ rows are to be returned (assuming the table has at least _N_ rows and that the qualification
  