June 2015
Beginner
140 pages
3h
English
In a table with lots of rows, we will probably want to restrict the number of rows that we retrieve. We can do this using one or more WHERE clauses. When filtering, we can use either full and exact column values or partial values.
When filtering by exact values, we use the full value of a column. For example, a WHERE clause to retrieve data about everyone born on or after January 1, 1970 is given as follows:
WHERE birthday >= '1970-01-01'
The output will look similar to the following:
MariaDB [test]> SELECT * FROM employees -> WHERE birthday >= '1970-01-01'; +----+----------------+---------------+-----------+------------+ | id | surname | givenname | pref_name | birthday | +----+----------------+---------------+-----------+------------+ ...
Read now
Unlock full access