Business Database Technology (2nd Edition) by Shouhong Wang;Hai Wang;
Author:Shouhong Wang;Hai Wang;
Language: eng
Format: epub
Publisher: Universal Publishers
Listing 6.30. An Example of Query with Integration of Clauses
6.14. UNION Operator
The UNION operator connects two SELECT statements to include the query results of the first SELECT statement and the second SELECT statement. As an illustrative example, the query in Listing 6.31 is to âlist the course ID and course enrollment for each course that has enrollment greater than 35, or the student name and student ID for each student who enrolled after 2019.â In fact, the UNION operator is a kind of OR operator between the two SELECT statements. This example is merely to demonstrate how the UNION operator works. As shown in this example, if the attributes listed in the two SELECT statements are not comparable, the query result of the UNION operator would not be particularly meaningful. As the UNION operator often introduces confusion, it is not recommended for beginners.
SELECT CourseID AS Name, CourseEnrollment AS Data
FROM tblCourse
WHERE CourseEnrollment>35
UNION
SELECT StudentName AS Name, StudentID AS Data
FROM tblStudent
WHERE StudentEnrolYear>2019;
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Access | Data Mining |
Data Modeling & Design | Data Processing |
Data Warehousing | MySQL |
Oracle | Other Databases |
Relational Databases | SQL |
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8305)
Azure Data and AI Architect Handbook by Olivier Mertens & Breght Van Baelen(6770)
Building Statistical Models in Python by Huy Hoang Nguyen & Paul N Adams & Stuart J Miller(6745)
Serverless Machine Learning with Amazon Redshift ML by Debu Panda & Phil Bates & Bhanu Pittampally & Sumeet Joshi(6632)
Data Wrangling on AWS by Navnit Shukla | Sankar M | Sam Palani(6414)
Driving Data Quality with Data Contracts by Andrew Jones(6356)
Machine Learning Model Serving Patterns and Best Practices by Md Johirul Islam(6119)
Learning SQL by Alan Beaulieu(6000)
Weapons of Math Destruction by Cathy O'Neil(5787)
Big Data Analysis with Python by Ivan Marin(5376)
Data Engineering with dbt by Roberto Zagni(4381)
Solidity Programming Essentials by Ritesh Modi(4028)
Time Series Analysis with Python Cookbook by Tarek A. Atwan(3889)
Pandas Cookbook by Theodore Petrou(3593)
Blockchain Basics by Daniel Drescher(3303)
Hands-On Machine Learning for Algorithmic Trading by Stefan Jansen(2911)
Feature Store for Machine Learning by Jayanth Kumar M J(2816)
Learn T-SQL Querying by Pam Lahoud & Pedro Lopes(2799)
Mastering Python for Finance by Unknown(2746)
