1775060033 select * from patients where op_processed=0 and op_attempt_no<3 and cliniko_id in (select patient_id from appointments) order by id limit 0,51775060033