Content deleted Content added
Rescuing orphaned refs ("ms-sql-select-into" from SQL syntax) |
m v2.03b - Bot T19 CW#83 - WP:WCW project (Heading start with three "=" and later with level two) |
||
Line 12:
* <code>[[Alias (SQL)|AS]]</code> provides an alias which can be used to temporarily rename tables or columns.
<code>SELECT</code> is the most common operation in SQL, called "the query". <code>SELECT</code> retrieves data from one or more [[Table (database)|table]]s, or expressions. Standard <code>SELECT</code> statements have no persistent effects on the database. Some non-standard implementations of <code>SELECT</code> can have persistent effects, such as the <code>SELECT INTO</code> syntax provided in some databases.<ref name="ms-sql-select-into">{{ cite book | chapter = Transact-SQL Reference | title = SQL Server Language Reference | series = SQL Server 2005 Books Online | publisher = Microsoft | date = 2007-09-15 | url = http://msdn.microsoft.com/en-us/library/ms188029.aspx | accessdate = 2007-06-17 }}</ref>
Line 110:
</source>
Queries can be nested so that the results of one query can be used in another query via a relational operator or aggregation function. A nested query is also known as a ''subquery''. While joins and other table operations provide computationally superior (i.e. faster) alternatives in many cases, the use of subqueries introduces a hierarchy in execution that can be useful or necessary. In the following example, the aggregation function <code>AVG</code> receives as input the result of a subquery:
Line 127:
Since 1999 the SQL standard allows named subqueries called [[common table expression]]s (named and designed after the IBM DB2 version 2 implementation; Oracle calls these [[subquery factoring]]). CTEs can also be [[recursive]] by referring to themselves; [[Hierarchical and recursive queries in SQL|the resulting mechanism]] allows tree or graph traversals (when represented as relations), and more generally [[fixpoint]] computations.
An Inline view is the use of referencing an SQL subquery in a FROM clause. Essentially, the inline view is a subquery that can be selected from or joined to. Inline View functionality allows the user to reference the subquery as a table. The inline view also is referred to as a ''derived table'' or a ''subselect''. Inline view functionality was introduced in Oracle 9i.<ref name="Inline View/Derived Table" />
|