Taken from the MySQL manual (13.2.10.11 Rewriting Subqueries as Joins):
A LEFT [OUTER] JOIN can be faster than an equivalent subquery because the server might be able to optimize it better—a fact that is not specific to MySQL Server alone.
So subqueries can be slower than LEFT [OUTER] JOIN
, but in my opinion their strength is slightly higher readability.
Related Posts:
- How can I do a FULL OUTER JOIN in MySQL?
- MySQL Multiple Joins in one query?
- MySQL Error: : ‘Access denied for user ‘root’@’localhost’
- What is the difference between “INNER JOIN” and “OUTER JOIN”?
- What is the difference between “INNER JOIN” and “OUTER JOIN”?
- Unknown column in ‘field list’ error on MySQL Update query
- Unknown column in ‘field list’ error on MySQL Update query
- SQL Inner-join with 3 tables?
- What’s the difference between INNER JOIN, LEFT JOIN, RIGHT JOIN and FULL JOIN? [duplicate]
- MySQL – Operand should contain 1 column(s)
- MySQL “CREATE TABLE IF NOT EXISTS” -> Error 1050
- MySQL Error: : ‘Access denied for user ‘root’@’localhost’
- MySQL create table if not exists and insert record only if table was created
- How do I use properly CASE..WHEN in MySQL
- Nested select statement in SQL Server
- MySQL query String contains
- What’s the difference between VARCHAR and CHAR?
- Case statement in MySQL
- How to declare a variable in MySQL?
- MySQL Cannot Add Foreign Key Constraint
- How to split the name string in mysql?
- How do I import an SQL file using the command line in MySQL?
- Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)
- mysql Foreign key constraint is incorrectly formed error
- MySQL: Invalid use of group function
- How can I return pivot table output in MySQL?
- Difference between JOIN and INNER JOIN
- Compare dates in MySQL
- MySQL “WITH” clause
- What is the difference between JOIN and UNION?
- Error Code: 2013. Lost connection to MySQL server during query
- MySQL syntax for Join Update
- SQL join on multiple columns in same tables
- Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)
- how to drop partition without dropping data in MySQL?
- 1052: Column ‘id’ in field list is ambiguous
- 1052: Column ‘id’ in field list is ambiguous
- MySQL combine two columns into one column
- Simple way to calculate median with MySQL
- Error 1046 No database Selected, how to resolve?
- MySQL Error 1264: out of range value for column
- Remove duplicate rows in MySQL
- How to SUM and SUBTRACT using SQL?
- Cast from VARCHAR to INT – MySQL
- SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax — PHP — PDO [duplicate]
- How do you force mysql LIKE to be case sensitive?
- MySQL – UPDATE multiple rows with different values in one query
- Postgres Error: More than one row returned by a subquery used as an expression
- How to create a MySQL hierarchical recursive query?
- ERROR 1148: The used command is not allowed with this MySQL version
- Insert into a MySQL table or update if exists
- How to round down to nearest integer in MySQL?
- MySQL starts with searching issue
- Query to convert from datetime to date mysql
- Is it possible to GROUP BY multiple columns using MySQL?
- MySQL error: key specification without a key length
- What is the difference between LATERAL JOIN and a subquery in PostgreSQL?
- Best way to test if a row exists in a MySQL table
- Check if MySQL table exists without using “select from” syntax?
- MySQL equivalent of DECODE function in Oracle
- mysql update column with value from another table
- The used SELECT statements have a different number of columns
- How to delete from multiple tables in MySQL?
- MySQL: Can’t create table (errno: 150)
- How to copy a row and insert in same table with a autoincrement field in MySQL?
- updating table rows in postgres using subquery
- Alternative to except in MySQL
- Equivalent of explode() to work with strings in MySQL
- ROW_NUMBER() in MySQ
- MySQL OPTIMIZE all tables?
- MySQL INSERT INTO table VALUES.. vs INSERT INTO table SET
- MySQL – Get row number on select
- MySQL error: Unknown column in ‘where clause’
- How to truncate the text returned for a column in a MySQL query
- Using union and order by clause in mysql
- MySQL LIKE IN()?
- Efficiently convert rows to columns in sql server
- Cannot delete or update a parent row: a foreign key constraint fails
- Sql Server equivalent of a COUNTIF aggregate function
- Column name or number of supplied values does not match table definition
- SQL – HAVING vs. WHERE
- What’s the difference between RANK() and DENSE_RANK() functions in oracle?
- ERROR: there is no unique constraint matching given keys for referenced table “bar”
- How do I query for all dates greater than a certain date in SQL Server?
- Conversion failed when converting the varchar value ‘simple, ‘ to data type int
- postgresql: error duplicate key value violates unique constraint
- Is there a workaround for ORA-01795: maximum number of expressions in a list is 1000 error?
- ORA-06502: PL/SQL: numeric or value error: character string buffer too small
- Update statement with inner join on Oracle
- LEFT function in Oracle
- SQLite string contains other string query
- How to get the count of each distinct value in a column?
- Cannot insert explicit value for identity column in table ‘table’ when IDENTITY_INSERT is set to OFF
- Better way to migrate to server?
- Why does changing Database Table Prefixes result in loss of content?
- WP MultiSite: Can’t select database error after changing to new domain
- Help me SELECT thumbnail from SQL and use
- Database SQL query error
- Creating a “forum” – showing last post or last commented post
- Replace Unwanted Space in Post Content URL