Subqueries Not Always Allowed

Unlike SQL Anywhere, SAP Sybase IQ does not allow subqueries to appear wherever expressions are allowed.

SAP Sybase IQ supports subqueries only as allowed in the SQL-1989 grammar, plus in the SELECT list of the top level query block or in the SET clause of an UPDATE statement. SAP Sybase IQ does not support SQL Anywhere extensions.

Many SQL implementations allow subqueries only on the right side of a comparison operator. For example, the following command is valid in SAP Sybase IQ but not valid in most other SQL implementations.

SELECT		SurName,
			BirthDate,
			(	SELECT DepartmentName 
				FROM Departments
				WHERE DepartmentID = Employees.EmployeeID
				AND DepartmentID = 200 )
FROM Employees