How to make multiple LEFT JOINs with OR fully use a composite index? (part 2)
问题 It is for a system that calculates how the users scan their fingerprints when they enter/leave the workplace. I don't know how it is called in English. I need to determine if the user is late in the morning, and if the user leaves work early. This tb_scan table contains date and time a user scans a fingerprint. CREATE TABLE `tb_scan` ( `scpercode` varchar(6) DEFAULT NULL, `scyear` varchar(4) DEFAULT NULL, `scmonth` varchar(2) DEFAULT NULL, `scday` varchar(2) DEFAULT NULL, `scscantime`