Grouping and aggregation

In all previous examples, the number of records returned by the SELECT query is the same as the number of rows from the input table (or tables) after filtering. In other words, every row from any of the source tables (or joined tables) becomes exactly one row in the query result. Rows are processed one by one.

SQL provides a way to get some aggregated results of processing several records at a time and get the result in one single row. The easiest example would be counting the total number of records in the table. The input is all the records of a table. The output is one single record. Grouping and aggregation is used for this.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset