In MySQL, the UNION
clause combines the results from multiple queries into a single result set.
Category: MySQL
3 Ways to Select the Row with the Minimum Value in SQL
Here are three examples of using SQL to find and select the row with the minimum value in a given column.
The examples work in most major RDBMSs, including MySQL, MariaDB, PostgreSQL, SQLite, Oracle, and SQL Server.
Continue reading5 Ways to Select Rows with the Maximum Value for their Group in SQL
Here are five options for using SQL to return only those rows that have the maximum value within their group.
These examples work in most major RDBMSs, including MySQL, MariaDB, Oracle, PostgreSQL, SQLite, and SQL Server.
Continue readingFind Values That Don’t Contain Numbers in MySQL
If you need to return all rows that don’t contain any numbers, the following might help.
Strictly speaking, numbers can be represented by words and other symbols, but for this article “number” simply means “numerical digit”. So we’re finding values that don’t contain any numerical digits.
Continue reading3 Ways to Select the Row with the Maximum Value in SQL
Here are three examples that use SQL to find and select the row with the maximum value in a given column.
The examples work in most major RDBMSs, including MySQL, MariaDB, PostgreSQL, SQLite, Oracle, and SQL Server.
Continue reading4 Ways to Find Duplicate Rows in MySQL
If you think a MySQL table might have duplicate rows, you can use the following options to return all duplicates.
Continue readingHow to Get Multiple Rows into a Comma Separated List in SQL
Most of the major RDBMSs have a function that enables us to return our query results as a comma separated list.
That is, we can use such a function to convert each row into a separate list item, within a comma separated list.
Below are examples of how to achieve this in some of the more popular RDBMSs.
Continue reading3 Ways to Find Rows that Contain Lowercase Letters in MySQL
Here are three options for returning rows that contain lowercase characters in MySQL.
Continue reading2 Ways to Return Rows that Contain Alphanumeric Characters in MySQL
Below are two options for finding those rows that contain alphanumeric characters in MySQL.
Alphanumeric characters are alphabetic characters and numeric characters.
Continue readingFix MySQL Warning 1287: ‘BINARY expr’ is deprecated and will be removed in a future release
If you get warning number 1287 that reads ‘BINARY expr’ is deprecated and will be removed in a future release. Please use CAST instead when running a query in MySQL, it’s because you’re using the BINARY
operator.
The BINARY
operator is deprecated as of MySQL 8.0.27.
To fix the issue, cast the value to binary using the CAST()
function instead.