select t1.showCode, t1.Name, t1.Sex, t.AppointmentDate from ((select *from myris.appointment where AppointmentDate >= date_sub(current_date(), interval '10' day) and isFinish = 0 ) t
inner join (select *from myris.patient where (Name like '%2%' or showCode like '%2%') and HospitalID = '20220302160409') t1 on t.PatientID = t1.PatientID) order by t.AppointmentDate desc;