Are sub-SELECT's in SELECT and FROM clauses standard-compliant?
The title pretty much says it all. Under "standard-compliant" SQL I mean SQL constructs allowed in any of SQL 开发者_如何学Pythonstandards.
I looked through the "Understanding SQL" book, but it mentions subqueries only inside WHERE
, GROUP BY
, HAVING
etc. clauses, not SELECT
and FROM
(or maybe I'm missing something).
I know MS SQL allows sub-SELECT's in SELECT
and FROM
. I would like to know if it is a standard behavior. Or maybe it isn't standard, but is now implemented in major SQL databases (I have very little experience with DB's other than MS SQL)?
Yes. You can use a subquery as a derived table wherever you can use a table in a select statement.
SQL ANSI 92
精彩评论