Tagged articles
WHERE clause
21 articles · Page 1 of 1
This article explains why SQL NULL represents an unknown state rather than a value, how three-valued logic (TRUE, FALSE, UNKNOWN) breaks equality comparisons, and demonstrates practical pitfalls with WHERE clauses, NOT IN subqueries, aggregate functions, and MySQL's NULL-safe operator.
NOT IN pitfallNULLSQL
0 likes · 9 min read

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 clauseLEFT JOIN
0 likes · 9 min read

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 JOINLEFT JOINON clause
0 likes · 7 min read


ITPUBAug 7, 2026 · Databases
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

A developer wrote an UPDATE statement that unintentionally used AND inside the SET clause and omitted a WHERE clause, causing MySQL to silently update every row in the table without raising any syntax errors.
SET clauseSQLSQL pitfalls
0 likes · 3 min read

The article explains why adding conditions after a LEFT JOIN using AND does not filter the number of rows returned, clarifies the distinct roles of ON and WHERE clauses, and demonstrates the behavior with multiple SQL examples and visual illustrations.
LEFT JOINON clauseWHERE clause
0 likes · 5 min read

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

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

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

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

This article walks through MySQL 8.0.32 source code to explain how the server builds a tree for a WHERE clause, evaluates each condition using classes such as Item_cond_and, Item_cond_or, Item_func_gt, and Item_func_eq, and ultimately decides whether a row satisfies the query.
SQLSource Code AnalysisWHERE clause
0 likes · 19 min read

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

This article explains the difference between ON and WHERE clauses in MySQL LEFT JOIN, illustrates why a proposed optimization for DBLE sharding does not work, and provides practical examples and pseudo‑code to clarify how MySQL processes left joins.
DBLELEFT JOINON clause
0 likes · 8 min read

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

This guide explains how LEFT JOIN creates a temporary result set, compares the effects of applying a WHERE filter after the join versus embedding the condition in the ON clause, and shows practical SQL examples with sample tables and result analysis.
LEFT JOINON clauseSQL
0 likes · 5 min read

This article explains how LEFT JOIN always returns all rows from the left table, how conditions placed in the ON clause affect only the right‑table matching without filtering left‑table rows, and how a WHERE clause filters the final result, illustrated with multiple SQL examples.
LEFT JOINON clauseSQL
0 likes · 4 min read

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

This article explains how LEFT JOIN works in SQL, clarifying that the ON clause only matches rows without filtering left‑table records while the WHERE clause filters the joined result, and demonstrates the differences with multiple code examples and table illustrations.
LEFT JOINON clauseSQL
0 likes · 5 min read

This article explains why adding extra conditions after the ON clause in a LEFT JOIN does not reduce the number of rows from the left table, clarifies the difference between ON and WHERE filters, and demonstrates the behavior with practical SQL examples and diagrams.
LEFT JOINON clauseSQL
0 likes · 5 min read

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.
Database PerformanceDynamic SQLSQL
0 likes · 3 min read

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.
Dynamic QueryIndexingSQL
0 likes · 3 min read
