Delete with subquery with no unique columns I have a table LIKES (ID1, ID2). Both id1 and id2 are non unique columns.

Database is SQLite

delete from LIKES where ID1 = 10   /// Wrong there more then one record with ID1=10
delete from LIKES where ID2 = 's ...'  /// Wrong there more then one record with ID1=155
delete from LIKES where ID1 = 10 and ID2='s ....' /// right query but i have to find out 
             values of id1 and id2 before to make run this query

delete from LIKES where id1=m and id2=t (select m, n  from table where ...some condition)


The last query does not work
Try using an EXISTS operator in your WHERE clause. I am not 100% of the exact syntax for sqlite but in SQL Server I would do something similar to the following:

DELETE from likes 
WHERE  EXISTS (SELECT *
               FROM   table 
               WHERE  likes.id1 = table.m
                      AND likes.id2 = table.n
                      AND your other conditions )