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.
This post is a short note on how to install Postgres on Ubuntu 20.04. I’m doing this in WSL, however this shouldn’t make any difference if you’re on the same Ubuntu version.
This is a post containing a query that’ll bring back all schemas, tables, and columns in Redshift or Postgres databases. I’m combining the Redshift and Postgres database blog categories here…
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.
If you forget what you entered as the postgres user password during installation, then this is a guide for you! It’s exactly what I did which is the reason for a post.