I have a task to automatically bill all registered patients in PatientsInfo table an Annual Bill of N2,500 base on the DateCreated column.
PatientsInfo
DateCreated
Assuming the columns of the 2 tables are the same:
INSERT INTO PatientDebit SELECT * from PatientsInfo WHERE DateCreated
Make sure you have an index on DateCreated if PatientsInfo has a lot of records as it could potentially be slow otherwise