What would you do if you were asked to identify top-ten products based on their prices? In SQL Server, using a TOP clause with a
Category: MySQL
Aggregate Functions in Analytic Context
The functions SUM, AVG, COUNT, MIN, and MAX are well-known aggregate functions that we use every day. They are to compute/summarize the multiple rows by
Computing Running & Cumulative Average
This article helps you understand how to calculate the running average and cumulative average on a given data set. As discussed earlier, windowing functions
Concatenate rows (group concatenation) in MySQL, Hive, SQL Server and Oracle
The CONCAT() function joins the input strings or different column values and returns as a single string. However, if we need to concatenate rows of
DISTINCT vs APPROXIMATE DISTINCT
As all (or most) of us know, SELECT DISTINCT eliminates duplicate records from the results and returns only unique values. But it’s very expensive in
Creating Table From Existing Table in Hive, Impala, SQL Server, Oracle SQL*Plus, PostgreSQL and MySQL
In some scenarios we may need to create a table based on the existing ones. Sometimes we may need the table along with the data