The time is a datetime types, pac is float type
Every day I want to check all the siteid at all time points on the day of the avg (pac) appeared the maximum of the time, could you tell me how to write the SQL?
My original SQL is like this:
Example. Select the t1 time, Max (apac) as mpac from (select time, avg example (Pac) as apac from A where clause time>="2017-09-20" and time<="2017-10-30" group by time) t1 group by DATE_FORMAT (time, "% % Y - m - % d");
But this check out time is wrong, is a day after the start time of
How should I change
CodePudding user response:
Select *From A a1
Where not exits (select 1 from a2 where A date (a1. Time)=date (a2) time) and a1. Siteid
CodePudding user response: