Comment on I accidentally removed the WHERE clause from my SQL query in a personal tool. Every row is now the same. I lost everything, have no backup, and I'm stupid.

o11c@programming.dev ⁨11⁩ ⁨months⁩ ago

This is about the one thing where SQL is a badly designed language, and you should use a frontend that forces you to write your queries in the order (table, filter, columns) for consistency.

UPDATE table_name WHERE y = $3 SET w = $1, x = $2, z = $4 RETURNING *
FROM table_name SELECT w, x, y, z

source
Sort:hotnewtop