ODBC4x
SQL Syntax Table Using the ODBC Driver
  The ProvideX ODBC driver supports the SQL syntax described in the table below. For an illustration of this syntax, see Constructing a Left Outer Join Using the Syntax Table.

In the following table, SQL keywords are shown in uppercase, vertical bars (pipes) "|" separate choices where more than one command is represented, and a blank indicates that no qualifier is required:

Syntax Description
statement SELECT top select orderby | INSERTinsert | DELETEdelete | UPDATEupdate
top blank| TOPinteger
select selectcols FROM tablelist where groupby having
delete FROM tablename where
insert INTO tablename insertvals
update tablename SETsetlist where
setlist set | setlist , set
set columnname =NULL | columnname = expression
insertvals ( columnlist ) VALUES( valuelist ) | VALUES ( valuelist ) |
( columnlist ) VALUES( SELECTselect ) |
VALUES( SELECTselect )
columnlist columnname , columnlist | columnname
valuelist NULL , valuelist |expression , valuelist |expression | NULL
selectcols selectallcols * | selectallcols selectlist
selectallcols blank| ALL| DISTINCT
selectlist selectlistitem , selectlist | selectlistitem
selectlistitem expression | expression aliasname | expression ASaliasname | aliasname.* | colref
where blank| WHEREboolean
having blank| HAVINGboolean
boolean and | and ORboolean
and not | not AND and
not comparison | NOTcomparison
comparison ( boolean )|colref ISNULL|colref ISNOTNULL |
expression
LIKEpattern |expression NOTLIKE pattern |
expression IN ( valuelist )|expression NOTIN ( valuelist ) |
expression op expression |EXISTS( SELECTselect ) |
expression op selectop ( SELECTselect ) |

expression IN ( SELECTselect ) |
expression NOTIN( SELECTselect ) |
expression BETWEEN expression AND expression)|

expression NOT BETWEEN expression AND expression)
selectop blank| ALL | ANY
op > | >= | < | <= | = | <>
pattern string | ? | USER
expression expression + times | expression - times | times
times times * neg|times / neg|neg
 
neg term | + term | - term
term ( expression ) | colref | simpleterm | aggterm scalar
scalar scalarescape | scalarshorthand
scalarescape --* (VENDOR(MICROSOFT),PRODUCT(ODBC) FNfn ) *--
scalarshorthand { FNfn }
fn functionname ( valuelist )|functionname( )
aggterm COUNT ( * ) | AVG ( expression ) | MAX( expression ) |
MIN( expression ) | SUM ( expression ) |
COUNT( expression )
simpleterm string|realnumber|?|USER|date|time|timestamp
groupby blank| GROUPBYgroupbyterms
groupbyterms colref|colref , groupbyterms
orderby blank| ORDERBYorderbyterms
orderbyterms orderbyterm|orderbyterm , orderbyterms
orderbyterm colref asc|integer asc
asc blank| ASC| DESC
colref aliasname . columnname |columnname
tablelist tablelistitem , tablelist|tablelistitem
tablelistitem tableref | outerjoin
outerjoin ojescape | ojshorthand
ojescape --*(VENDOR(MICROSOFT),PRODUCT(ODBC) OJ oj )*--
ojshorthand { OJoj }
inneroj tableref INNERJOINtableref ONboolean |
tableref INNERJOINinneroj ONboolean
oj tableref LEFTOUTERJOINtableref ONboolean |
tableref
LEFTOUTERJOINoj ONboolean | inneroj
tableref tablename | tablename aliasname
indexname identifier
functionname identifier (see Scalar Functions, below).
tablename identifier
datatype identifier
columnname identifier
aliasname identifier
identifier Identifier (must be enclosed in double quotes if it contains spaces).
string String (enclosed in single quotes).
realnumber Non-negative real number (including E notation).
integer Non-negative integer.
date dateescape | dateshorthand
dateescape --*(VENDOR(MICROSOFT),PRODUCT(ODBC) d dateval )*--
dateshorthand { d dateval }
dateval Date in yyyy-mm-dd format in single quotes; e.g., '1996-02-05'.
time timeescape | timeshorthand
timeescape --*(VENDOR(MICROSOFT),PRODUCT(ODBC) t timeval )*--
timeshorthand { t timeval }
timeval Time in hh:mm:ss format in single quotes; e.g., '10:19:48'
timestamp timestampescape | timestampshorthand
timestampescape --*(VENDOR(MICROSOFT),PRODUCT(ODBC) ts timestampval )*--
timestampshorthand { ts timestampval }
timestampval Timestamp in yyyy-mm-dd hh:mm:ss[.ffffff] format in single quotes; e.g., '1996-02-05 10:19:48.529'.