Hacker News new | past | comments | ask | show | jobs | submit login

Been a few decades, but I was in a similar situation and came up with a similar approach. Run the select first and then swap in an update or delete.

If the query was somewhat involved to determine what to delete, I’d write the select query to just select row IDs of rows for deletion (assuming a simple primary key), then wrap that with a “delete from table where ID in (select ID from …complex query…)”.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: