SELECT * from LOGS where User = "Aleksandr" and Day = "2017-03-13" and TYPE = "ON" order by Time LIMIT 1;
SELECT * from LOGS where User = "Aleksandr" and Day = "2017-03-13" and TYPE = "OFF" order by Time DESC LIMIT 1;
delete from WEBLOGS where Day = "2017-03-10";