There are two criteria for writing a query that runs on both Sybase IQ and Adaptive Server Enterprise databases.
The data types, expressions, and search conditions in the query must be compatible.
The syntax of the SELECT statement itself must be compatible.
Sybase IQ supports the following subset of the Transact-SQL SELECT statement.
SELECT [ ALL | DISTINCT ] select-list …[ INTO #temporary-table-name ] …[ FROM table-spec, … table-spec, … ] …[ WHERE search-condition ] …[ GROUP BY column-name, … ] …[ HAVING search-condition ] …| [ ORDER BY expression [ ASC | DESC ], … ] | | [ ORDER BY integer [ ASC | DESC ], … ] |
select-list: { table-name.* }… { * }… { expression }… { alias-name = expression }… { expression as identifier }… { expression as T_string }…
table-spec:
[ owner. ]table-name
… [ [ AS ] correlation-name ]
…
alias-name: identifier | 'string' | “string"
The sections that follow provide details on several items to be aware of when writing compatible queries.