I am stuck with mysql query.Not able to proceed.
I have 2 tables where user's login time is recorded.Login time should be considered when either of the table contains entry. I want to find userwise sum of logins for a month.
I could reach till here. But not able to understand how to get sum
select table1.employeeId , date(table1.loginTime) as date1 , date(table2.loginTime) as date2 from table1 inner join table2 on table1.employeeId=table2.employeeId and table1.loginTime>='2017-01-01 00:00:00' and table1.loginTime<='2017-01-31 23:59:59' and table2.loginTime>='2017-01-01 00:00:00' and table2.loginTime<='2017-01-31 23:59:59' For ex : count=0 employe1 logged
on 1-Jan-2017 in table1 & table2 <- count++ (if he logs in 2 tables then only 1 count should be considered)
on 2-Jan-2017 in table1 <- count++
So for employee1 count is 2
