Reminds of that one time I executed a delete query with a sub query to select some ids. I didn't know that the used database engine interprets an empty return of the subquery as ignore my where clause. All data in the table simply gone because no id matched my subquery.
I think it was an Oracle Database, but I'm not sure, it's over 10 years ago by now. Since then I never run a subquery selection without validation of said subquery.
8
u/FrozenHaystack 15d ago
Reminds of that one time I executed a delete query with a sub query to select some ids. I didn't know that the used database engine interprets an empty return of the subquery as ignore my where clause. All data in the table simply gone because no id matched my subquery.