Close
  • Blog
  • About
×
×
  • Blog
  • About
Menu & Search
Peter Whyte DBA Blog
Tag

SQL Tips


May 5, 2022
MySQL
PostgreSQL
RedShift
Why Use WHERE 1=2 in SQL

Some time ago I wrote short blog post on why use WHERE 1=1 in SQL. This time it’s why use WHERE 1=2, but really this can be WHERE 1=9 or anything that isn’t a 1, we just want the false statement.

Read More
SQL Scripts Feature
September 21, 2020
MySQL
PostgreSQL
RedShift
Why use WHERE 1=1 in SQL Queries

A common SQL question is, why does anyone use WHERE 1=1 in their queries? And what does it do? The condition means WHERE TRUE, so it’s just bringing back the same query result as it would without.

Read More

Blog Menu

  • Homepage
  • Projects
  • Notes
  • Archives

Categories

  • AWS (3)
  • Linux (21)
  • MySQL (5)
  • PostgreSQL (7)
  • PowerShell (32)
  • RedShift (6)
  • Scripts (1)
  • SQL Server (54)
  • Windows (40)
  • WordPress (5)

Tags

Certificates & Encryption (3) CSV Files (3) Database Admin (35) Database Backups (5) Data Types (2) Deleting Data (2) Error Messages (4) Exporting Data (1) Featured (6) Git (7) Importing Data (1) Installing SQL Server (8) Linked Servers (3) Linux Admin (2) Logging & Monitoring (1) Measuring Databases (7) Restoring Databases (4) SQL Server Agent (3) SQL Server ETL (2) SQL Server Management Studio (9) SQL Server Processes (4) SQL Server Scripts (2) SQL Tips (2) Windows Admin (9) WordPress Tutorials (2) WSL (10)