Avoid SQL Nightmares

It’s a simple, simple tip:

Instead of being all like

DELETE * FROM users
WHERE id = 23

How about first you go

SELECT * FROM users
WHERE id =23

and once you’ve seen the results and are sure you’ve got it exactly right, then and only then, change SELECT * to DELETE

Leave a reply