Using SELECT Statements as Table Names

Microsoft® SQL Server™ and Oracle support the use of SELECT statements as table names when performing queries. However, one important difference is that an alias must be provided with the SQL Server SELECT statement, while an alias is optional with Oracle.

Oracle SQL Server
SELECT SSN, LNAME, FNAME,
TUITION_PAID, SUM_PAID
FROM STUDENT_ADMIN.STUDENT,
(SELECT SUM(TUITION_PAID) SUM_PAID
FROM STUDENT_ADMIN.STUDENT)
SELECT SSN, LNAME, FNAME,
TUITION_PAID, SUM_PAID
FROM STUDENT_ADMIN.STUDENT,
(SELECT SUM(TUITION_PAID) SUM_PAID
FROM STUDENT_ADMIN.STUDENT) SUM_STUDENT

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.