QA

Team-Fly    

 
Sams Teach Yourself SQL in 24 Hours, Third Edition
By Ronald R. Plew, Ryan K. Stephens
Table of Contents
Hour 15.  Combining Multiple Queries into One


Q&A

Q1:

How are the columns referenced in the GROUP BY clause when using the GROUP BY clause with a compound query?

A1:

The columns can be referenced by the actual column name or by the number of the column placement in the query if the column names are not identical in the two queries.

Q2:

I understand what the EXCEPT operator does, but would the outcome change if I were to reverse the SELECT statements?

A2:

Yes. The order of the individual queries is very important when using the EXCEPT or MINUS operator. Remember that all rows are returned from the first query that are not returned by the second query. Changing the order of the two individual queries in the compound query could definitely affect the results.

Q3:

Must the data type and the length of columns in a compound query be the same in both queries?

A3:

No. Only the data type must be the same. The length can differ .


Team-Fly    
Top
 


Sams Teach Yourself SQL in 24 Hours
Sams Teach Yourself SQL in 24 Hours (5th Edition) (Sams Teach Yourself -- Hours)
ISBN: 0672335417
EAN: 2147483647
Year: 2002
Pages: 275

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net