Here are three options for returning rows that contain uppercase characters in MySQL.
Continue readingCategory: MySQL
Fix “ERROR 1250 (42000): Table ‘…’ from one of the SELECTs cannot be used in global ORDER clause” when using UNION in MySQL
If you’re getting an error that reads “ERROR 1250 (42000): Table ‘…’ from one of the SELECTs cannot be used in global ORDER clause” when using the UNION
clause in a MySQL query, it’s probably because you’re qualifying a column name with its table name.
This doesn’t work in MySQL.
To fix this issue, either remove the table name or use a column alias.
Continue reading4 Ways to List All Tables in a MySQL Database
Below are four ways to list out the tables in a MySQL database using SQL or the command line.
Continue readingFix “ERROR 1054 (42S22): Unknown column ‘…’ in ‘order clause'” when using UNION in MySQL
If you’re getting error “1054 (42S22): Unknown column ‘…’ in ‘order clause'” when using the UNION
clause in MySQL, it could be because you’re trying to reference an aliased column by its column name.
Fix “ERROR 1136 (21S01): Column count doesn’t match value count at row 1” when Inserting Data in MySQL
One of the more common error message in MySQL goes like this: “ERROR 1136 (21S01): Column count doesn’t match value count at row 1“.
This error typically occurs when you’re trying to insert data into a table, but the number of columns that you’re trying to insert don’t match the number of columns in the table.
In other words, you’re either trying to insert too many columns, or not enough columns.
Continue reading7 Ways to Find Duplicate Rows while Ignoring the Primary Key in MySQL
Here are seven ways to return duplicate rows in MySQL when those rows have a primary key or other unique identifier column.
Continue readingMySQL TABLE Statement
In MySQL, the TABLE
statement returns rows and columns of the given table.
The TABLE
statement is similar to the SELECT
statement, and it can be used as a kind of shorthand version of the SELECT
statement.
The TABLE
statement was introduced in MySQL 8.0.19.
VALUES Statement in MySQL
In MySQL, the VALUES
statement returns a set of one or more rows as a table. Basically, it’s a table value constructor in accordance with the SQL standard, which also functions as a standalone SQL statement.
The VALUES
statement was introduced in MySQL 8.0.19.
SHOW TABLES in MySQL
In MySQL, SHOW TABLES
is an administrative statement that lists the non-TEMPORARY
tables and views in a given database.
SHOW TABLES
only lists the tables and views for which you have privileges.
5 Ways to Select Rows with the Minimum Value for their Group in SQL
Here are five options for using SQL to return only those rows that have the minimum value within their group.
These examples work in most major RDBMSs, including MySQL, MariaDB, Oracle, PostgreSQL, SQLite, and SQL Server.
Continue reading