user1854307
user1854307

Reputation: 630

Delete data in Room using INNER JOIN?

I try to delete data from room database using INNER JOIN.
My code does not build. Below is the error.

enter image description here

How to delete data using INNER JOIN?

Upvotes: 3

Views: 1128

Answers (2)

Gaëtan S
Gaëtan S

Reputation: 884

What about following query :

DELETE FROM waybills WHERE status IN (SELECT type FROM timestamps WHERE timestamp = 23)

Upvotes: 1

Amjad Alwareh
Amjad Alwareh

Reputation: 3261

Sqlite does't accept this syntax , because it is different from SQL Server.
so the best solution is
DELETE FROM waybills wb WHERE status IN (SELECT type FROM timestamps WHERE timestamp = 23)

Upvotes: 3

Related Questions