-- 2013-01-31 replacing school codes with school_id
SELECT contacts.id, last_name, idnumber, resource.id, resource.name FROM contacts, resource WHERE contacts.school_id=resource.school_id

UPDATE contacts, resource SET contacts.school_id=resource.id WHERE contacts.school_id=resource.school_id

UPDATE contacts SET date_entered='2012-01-31 12:00:00', date_modified='2012-01-31 12:00:00' WHERE date_entered='0000-00-00 00:00:00'

UPDATE resource_sub1 SET last_student_id_c=0, last_invoice_id_c=0, last_teacher_id_c=90000 WHERE 1

