Writing compatible queries

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

Sybase IQ supports the following subset of the Transact-SQL SELECT statement.

Syntax

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 ], ... ]	|

Parameters

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"

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

The sections that follow provide details on several items to be aware of when writing compatible queries.