Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Usage » Other SQL Dialects » Writing compatible SQL statements

Creating compatible tables Next Page

Writing compatible queries


There are two criteria for writing a query that runs on both SQL Anywhere and Adaptive Server Enterprise databases:

This section explains compatible SELECT statement syntax, and assumes compatible data types, expressions, and search conditions. The examples assume the quoted_identifier setting is Off: the default Adaptive Server Enterprise setting, but not the default SQL Anywhere setting.

SQL Anywhere supports the following subset of the Transact-SQL SELECT statement.

Syntax

SELECT [ ALL | DISTINCT ] select-list
...[ INTO #temporary-table-name ]
...[ FROM table-spec [ HOLDLOCK | NOHOLDLOCK ],
... table-spec [ HOLDLOCK | NOHOLDLOCK ], ... ]
...[ WHERE search-condition ]
...[ GROUP BY column-name, ... ]
...[ HAVING search-condition ]
[ ORDER BY { expression | integer }
[ ASC | DESC ], ... ]

Parameters

select-list:
table-name.*
| *
| expression
| alias-name = expression
| expression as identifier
| expression as string

table-spec:
[ owner . ]table-name
...[ [ AS ] correlation-name ]
...[ ( INDEX index_name [ PREFETCH size ][ LRU | MRU ] ) ]

alias-name:
identifier | 'string' | "string"

For a full description of the SELECT statement, see SELECT statement.

SQL Anywhere does not support the following keywords and clauses of the Transact-SQL SELECT statement syntax:

Notes