How to retrieve data using SELECT statement?

The only way to retrieve data from a MySQL column is to use the SELECT statement. This is also one of the most often used statements in MySQL. In broader terms, the SELECT...

SELECT Statement with WHERE Clause

The most frequent and simple data querying in MySQL is a combination of SELECT statement and WHERE clause, where the clause directly tells the MySQL how to reference wante...

Order retrieved data with ORDER BY clause

The ORDER BY clause can be used to sort the result with the respect to some column or in ascending or descending order. Following example shows a...

Grouping data in MySQL by using the GROUP BY clause

Grouping retrieved data with the GROUP BY clause, in combination with the

How to constrain (LIMIT) the number of rows in a result set?

The LIMIT clause limits the result of a query in the defined range. The range is defined by using one or two arguments, which both must be zero or a positive integer. The following...

Using HAVING clause to filter group of rows or aggregates

The HAVING clause is used to specify filtering condition for group of rows (or aggregates). It often comes with the

What are MySQL aliases and how to use them?

The aliases in MySQL may be used to improve readability of the queries. There are two kinds of aliases supported by MySQL, and these are: column alias tabl...