Retrieving Accurate Data

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


Be cautious when using the compound operators. Incorrect or incomplete data may be returned if you were using the INTERSECT operator and you used the wrong SELECT statement as the first individual query. In addition, consider whether duplicate records are wanted when using the UNION and UNION ALL operators. What about EXCEPT? Do you need any of the rows that were not returned by the second query? As you can see, the wrong compound query operator or the wrong order of individual queries in a compound query can easily cause misleading data to be returned.

graphics/note_icon.gif

Incomplete data returned by a query qualifies as incorrect data.



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