Sure, but like everyone else I have to ask.
why.
BM__subquery_rulesSubquery Rules
A subquery is subject to a number of restrictions:
- The select list of a subquery introduced with a comparison operator
can include only one expression or column name (except that EXISTS and IN
operate on SELECT * or a list, respectively).
- If the WHERE clause of an outer query includes a column name, it
must be join-compatible with the column in the subquery select list.
- The ntext, text and image data types are not allowed in the select
list of subqueries.
- Because they must return a single value, subqueries introduced by an
unmodified comparison operator (one not followed by the keyword ANY or ALL)
cannot include GROUP BY and HAVING clauses.
- The DISTINCT keyword cannot be used with subqueries that include
GROUP BY.
- The COMPUTE and INTO clauses cannot be specified.
- ORDER BY can only be specified if TOP is also specified.
- A view created with a subquery cannot be updated.
- The select list of a subquery introduced with EXISTS by convention
consists of an asterisk (*) instead of a single column name. The rules for a
subquery introduced with EXISTS are identical to those for a standard select
list because a subquery introduced with EXISTS constitutes an existence test
and returns TRUE or FALSE rather than data.
Donnie Shaw
Alaska Communications Systems, Inc
Database Administrator
(907) 564-1334
-----Original Message-----
From: Alex Hillman [mailto:alex_hillman_at_physia.com]
Sent: Monday, October 02, 2000 9:26 AM
To: Multiple recipients of list ORACLE-L
Subject: subselect in MS SQL Server
We are doing migration from Oracle to MS SQL Server ( don;t ask why). Does
anybody knows whether subselects could be used instead of columns in queries
Received on Mon Oct 02 2000 - 12:14:10 CDT