This is an old revision of the document!


DRAFT

Omnidex SQL: SELECT

Description

Syntax

SELECT expression_list
    FROM data_source
    [ WHERE predicates ]
    [ GROUP BY expression_list ]
        [ HAVING predicates ]
    [ ORDER BY expression_list ]
    [ ON [ CURSOR ] cursor_no ] | [ INSTANCE instance_no ]
    [ WITH options ]
expression_list
       [ < TOP (n) 
           [ SKIP(n) | EVERY(n) | RANDOM (n [, seed] ) ] ]
       [ < DISTINCT column | ALL >]
       [ SAMPLE(‘control_break’ [, ’qualifier’]) ] 
       [ UNION [ALL] | INTERSECT | EXCEPT ]
       [ * ] | [ table.]column [column_alias] [, table.column ... ]
       [ (subquery) ]
       [ aggregate_function( [table.]column ) ]
       [ $uniquekey | $odxid ]
       
FROM table1 [ table_alias ] [, table2 [ table_alias ] [ $omnidex ] ]
     [ LFET | RIGHT ]
         [ OUTER ]
         [ JOIN ]
         [ , table2 ]
         [ ON table1.linkfield = table2.linkfield ]
WHERE 
     [ EXISTS (subquery) ]
     [ IN (subquery) ]
GROUP BY
HAVING [ left_operand operator subquery ]
       [ left_operaand IN (subquery) ]
ORDER BY [column | position ] [, column | position ]

Discussion

SELECT
    [<TOP n [SKIP n] | EVERY n | RANDOM (n [,seed]) | SAMPLE('columns' [, 'qualifier'])]
    [<DISTINCT | ALL>]
    select_item [, select_item ...]
    [INTO table]
    FROM table_list
    [WHERE where_clause]
    [GROUP BY expression_list]
        [HAVING predicates ]
    [ORDER BY expression_list]
    [ON [CURSOR] cursor_no] | [INSTANCE instance_no]
    [WITH options]
select_item
    One of the following:
  • All columns for the named tables using a syntax of:

RIGHT> [OUTER JOIN [[[environment.]database.]table

        ON join_predicate [<AND | OR> NOT] join_predicate]
join_predicate
     [[[environment.]database.]table.column = [[[environment.]database.]table.column
                   
FROM data_source
WHERE Clause
GROUP BY Clause
HAVING Clause
ORDER BY Clause
WITH options

Examples

Simple

> select * from mytable

select columns

> select company, contact from mytable
 
Back to top
dev/sql/statements/select/home.1259639321.txt.gz · Last modified: 2012/10/26 14:28 (external edit)