Tagged articles

WHERE clause

20 articles · Page 1 of 1
Programmer XiaoFu
Programmer XiaoFu
Sep 29, 2026 · Databases

Why SQL Writing Order Differs from Execution Order: Explained

This article explains the difference between SQL's written clause order and its logical execution order, detailing why WHERE cannot use column aliases, how HAVING filters groups, the impact of JOIN/ON placement in LEFT JOINs, and how to verify execution plans with EXPLAIN.

EXPLAINHAVING clauseJOIN
0 likes · 9 min read
Why SQL Writing Order Differs from Execution Order: Explained
Java Captain
Java Captain
Sep 22, 2026 · Databases

MySQL JOIN: Why ON vs WHERE Placement Changes LEFT JOIN Results

This article explains how placing filter conditions in ON versus WHERE clauses affects MySQL JOIN results, demonstrating with concrete examples that INNER JOIN behaves equivalently while LEFT JOIN preserves driving table rows only when conditions are in ON, with SQL code and result comparisons.

INNER JOINJOINLEFT JOIN
0 likes · 7 min read
MySQL JOIN: Why ON vs WHERE Placement Changes LEFT JOIN Results
ITPUB
ITPUB
Aug 7, 2026 · Databases

Left Join: ON vs WHERE – Understanding the Crucial Difference

The article explains that in a LEFT JOIN the ON clause determines how rows are matched but never filters out rows from the left table, while a WHERE clause is applied after the join and can remove left‑table rows, illustrated with concrete SQL examples and step‑by‑step analysis.

LEFT JOINON clauseSQL
0 likes · 5 min read
Left Join: ON vs WHERE – Understanding the Crucial Difference
macrozheng
macrozheng
Sep 19, 2024 · Databases

Why LEFT JOIN Still Returns All Left Rows: ON vs WHERE Explained

This article explains why a LEFT JOIN always returns all rows from the left table, clarifies the difference between ON and WHERE clauses, demonstrates the behavior with multiple SQL examples and code snippets, and highlights the special handling of LEFT/RIGHT/FULL joins versus inner joins.

LEFT JOINON clauseSQL
0 likes · 6 min read
Why LEFT JOIN Still Returns All Left Rows: ON vs WHERE Explained
Architect's Guide
Architect's Guide
Sep 19, 2024 · Databases

Understanding LEFT JOIN ON vs WHERE Conditions in SQL

This article explains why adding conditions after a LEFT JOIN's ON clause does not filter rows, contrasts ON and WHERE behavior, and demonstrates the effect with multiple SQL examples and visual illustrations of temporary tables and join semantics.

Join TypesLEFT JOINON clause
0 likes · 6 min read
Understanding LEFT JOIN ON vs WHERE Conditions in SQL
dbaplus Community
dbaplus Community
Mar 13, 2024 · Databases

Why Developers Use “WHERE 1=1” in SQL Queries

The article explains the practical reasons for adding the always‑true condition “WHERE 1=1” in SQL, covering its role in preventing syntax errors, facilitating dynamic query building, copying tables, and its historical performance impact on MySQL.

Dynamic QuerySQLSQL injection
0 likes · 6 min read
Why Developers Use “WHERE 1=1” in SQL Queries
Java Architect Essentials
Java Architect Essentials
Oct 17, 2023 · Databases

Understanding LEFT JOIN ON vs WHERE Conditions in SQL

This article explains how LEFT JOIN works in SQL, clarifying the difference between ON‑clause conditions that affect the join process and WHERE‑clause filters that operate on the resulting temporary table, using multiple example queries and visual illustrations.

LEFT JOINON clauseQuery Optimization
0 likes · 5 min read
Understanding LEFT JOIN ON vs WHERE Conditions in SQL
Sohu Tech Products
Sohu Tech Products
Mar 29, 2023 · Databases

Understanding the Purpose and Impact of WHERE 1=1 in SQL Queries

This article explains why developers often include the redundant condition “WHERE 1=1” in SQL statements, demonstrating through performance tests that it has no effect on execution time, and describing its practical use for simplifying the addition of further conditions in both static and dynamic queries.

Best PracticesDynamic SQLQuery Optimization
0 likes · 6 min read
Understanding the Purpose and Impact of WHERE 1=1 in SQL Queries
Laravel Tech Community
Laravel Tech Community
Jan 25, 2022 · Databases

Understanding LEFT JOIN ON vs WHERE Conditions in SQL

This article explains why adding conditions after a LEFT JOIN's ON clause does not filter rows, contrasts ON and WHERE behavior, and demonstrates the differences with multiple SQL examples and visual illustrations of intermediate result tables.

LEFT JOINON clauseSQL
0 likes · 5 min read
Understanding LEFT JOIN ON vs WHERE Conditions in SQL
Top Architect
Top Architect
May 13, 2021 · Databases

Understanding LEFT JOIN ON vs WHERE Conditions in SQL

The article explains why adding conditions after a LEFT JOIN using AND does not filter rows from the left table, contrasts ON and WHERE clauses, and demonstrates the behavior with SQL examples and step‑by‑step illustrations of intermediate result tables.

Join TypesLEFT JOINON clause
0 likes · 6 min read
Understanding LEFT JOIN ON vs WHERE Conditions in SQL
Liangxu Linux
Liangxu Linux
Apr 22, 2021 · Databases

Why Developers Use ‘WHERE 1=1’ in SQL and How to Apply It Effectively

The article explains that inserting ‘WHERE 1=1’ in dynamically built SQL statements prevents syntax errors when appending additional conditions, illustrates its use with Java string concatenation examples, discusses performance considerations, and shows how to copy tables or duplicate structures using this technique.

Dynamic SQLSQLTable copy
0 likes · 3 min read
Why Developers Use ‘WHERE 1=1’ in SQL and How to Apply It Effectively
Top Architect
Top Architect
Mar 24, 2021 · Databases

Understanding the Use of WHERE 1=1 in Dynamic SQL

The article explains why developers insert the clause "WHERE 1=1" in dynamically generated SQL statements, shows example Java code, discusses how it prevents syntax errors when concatenating AND conditions, and offers advice on adding selective filters and indexes to avoid full table scans.

Database OptimizationDynamic QueryIndexing
0 likes · 3 min read
Understanding the Use of WHERE 1=1 in Dynamic SQL