Switch DELETE and LIKE in the SQLite statement

I tried to merge the two into a single statement, and I would even be satisfied with two separate statements… I know it must be possible, but how?

This is what I tried:

DELETE FROM myTable WHERE myValue LIKE'findme%';

and :

DELETE FROM myTable WHERE EXISTS (SELECT * FROM myTable WHERE myValue LIKE'findme%');

I get the error of the second statement, For example, you can only use the LIKE statement of another statement to get a result…

your first A statement should be valid. Is it possible to try without the final semicolon?

The second one is illogical. Your subquery is not related to the first one, and you cannot scan the table being modified. Actually, I expect from this query if it will Run, whether all rows are deleted, if there is a column that matches your column…

If you want to know why the solution with the IN clause works instead of EXISTS, it is because the EXISTS condition is for every One line is evaluated, while the IN set is evaluated once.

I tried to merge the two into a single statement, and I would even be satisfied with two separate statements ….. I know it must be possible, but how?

This is what I tried:

DELETE FROM myTable WHERE myValue LIKE'findme%';

and :

DELETE FROM myTable WHERE EXISTS (SELECT * FROM myTable WHERE myValue LIKE'findme%');

I get the error of the second statement, For example, you can only get a result with the LIKE statement of another statement…

Your first statement should be valid. Try without the final semicolon is it possible?

The second one is illogical. Your subquery is not related to the first one, and you cannot scan the table being modified. Actually, I expect from this query if it will Run, whether all rows are deleted, if there is a column that matches your column…

If you want to know why the solution with the IN clause works instead of EXISTS, it is because the EXISTS condition is for every One line is evaluated, while the IN set is evaluated once.

Leave a Comment

Your email address will not be published.