Effective SQL: 61 Specific Ways to Write Better SQL (Effective Software Development Series) by John L. Viescas & Douglas J. Steele & Ben G. Clothier
Author:John L. Viescas & Douglas J. Steele & Ben G. Clothier
Language: eng
Format: mobi, pdf
Publisher: Pearson Education
Published: 2017-01-08T23:00:00+00:00
Table 5.2 Aggregated inventory with ROLLUP data
We obtain a total quantity for each color and the overall quantity. However, we do not have any data on the total quantity by dimension, not considering color, because the ROLLUP works from right to left. To get that additional data, we can use CUBE instead. Listing 5.5 demonstrates the statement to obtain the results shown in Table 5.3.
Listing 5.5 CUBE sample query
Click here to view code image
SELECT Color, Dimension, SUM(Quantity)
FROM Inventory
GROUP BY CUBE (Color, Dimension);
Download
Effective SQL: 61 Specific Ways to Write Better SQL (Effective Software Development Series) by John L. Viescas & Douglas J. Steele & Ben G. Clothier.pdf
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.
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8296)
Azure Data and AI Architect Handbook by Olivier Mertens & Breght Van Baelen(6722)
Building Statistical Models in Python by Huy Hoang Nguyen & Paul N Adams & Stuart J Miller(6701)
Serverless Machine Learning with Amazon Redshift ML by Debu Panda & Phil Bates & Bhanu Pittampally & Sumeet Joshi(6572)
Data Wrangling on AWS by Navnit Shukla | Sankar M | Sam Palani(6357)
Driving Data Quality with Data Contracts by Andrew Jones(6306)
Machine Learning Model Serving Patterns and Best Practices by Md Johirul Islam(6073)
Learning SQL by Alan Beaulieu(5994)
Weapons of Math Destruction by Cathy O'Neil(5778)
Big Data Analysis with Python by Ivan Marin(5356)
Data Engineering with dbt by Roberto Zagni(4352)
Solidity Programming Essentials by Ritesh Modi(4000)
Time Series Analysis with Python Cookbook by Tarek A. Atwan(3858)
Pandas Cookbook by Theodore Petrou(3570)
Blockchain Basics by Daniel Drescher(3292)
Hands-On Machine Learning for Algorithmic Trading by Stefan Jansen(2905)
Feature Store for Machine Learning by Jayanth Kumar M J(2812)
Learn T-SQL Querying by Pam Lahoud & Pedro Lopes(2794)
Mastering Python for Finance by Unknown(2744)
