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 readingHere 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 readingThere are at least a few possible reasons you might be getting the dreaded error 1064 (42000) that reads “You have an error in your SQL syntax…” etc when trying to use the MINUS
operator in MariaDB.
I’ll explore these below and offer some solutions.
Continue readingIn MySQL, the UNION
clause combines the results from multiple queries into a single result set.
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 readingIn MariaDB, SHOW TABLES
is an administrative statement that lists the non-TEMPORARY
tables, sequences and views in a given database.
In Oracle Database, the INTERSECT
operator is used to create a compound query that returns the intersection of the results of the left and right SELECT
statements. In other words, it combines two queries, but returns only those rows that are returned in both queries.
The following examples return duplicate rows from an Oracle Database table.
Continue readingIf you’re getting “ERROR: missing FROM-clause entry for table” in PostgreSQL when using an operator such as UNION
, INTERSECT
, or EXCEPT
, it could be because you’re qualifying a column name with its table name.
To fix this, either remove the table name or use a column alias.
Continue readingIn Oracle Database, the MINUS
operator is used to return only unique rows returned by the first query but not by the second.
Here are four options for returning rows that contain uppercase characters in Oracle Database.
Continue reading