mysql - How to make multiple LEFT JOINs with OR fully use a composite index? (part 2) -
it system calculates how users scan fingerprints when enter/leave workplace. don't know how called in english. need determine if user late in morning, , if user leaves work early. this tb_scan table contains date , time user scans 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` datetime, key `all` (`scyear`,`scmonth`,`scday`) ) engine=myisam default charset=latin1 it has 100,000+ rows, this scpercode scyear scmonth scday scdateandtime 000001 2010 10 10 2016-01-10 08:02:00 000001 2010 10 10 2016-01-02 17:33:00 000001 2010 10 11 2016-01-11 07:48:00 000001 2010 10 11 2016-01-11 17:29:00 000002 2010 10 10 2016-01-10 17:31:00 000002 2010 10 10 2016-01-02 17:28:00 000002 2010 10 11 2016-01-11 05:35:00 0...