I have this code which should work
delete from ( select oi.* from orderinfo oi where oi.order_status = \'Выполнен\' and oi.rowid in ( select orderinfo.rowid f