cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

DELETE with JOIN

Former Member
4,046

I am using ultralitej database on android application and i need to delete rows with negative ID that exists in the same table with positive ID and same Code column. This sql executes without error in MSSql server but raises an error here: Syntax error near FROM at offset 10

DELETE r FROM Remote as r, Remote as r1 WHERE r.ID < 0 AND r.Code = r1.Code AND r1.ID > 0

Is there anything specific about delete with join in ultrealitej ? I tried with a subquery but got another error: Row has changed since last read -- operation canceled

DELETE FROM Remote WHERE  ID < 0 AND  
EXISTS (SELECT * FROM Remote rReal WHERE  rReal.ID > 0 AND rReal.Code = Remote.Code)
View Entire Topic
Former Member
0 Likes

The subquery worked.. i cannot explain why that error appeard, but now is working