clear markdown compare help best fiddles feedback dbanow.uk a leap of faith?
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 921219 fiddles created (11942 in the last week).

select version();
version()
8.0.18
 hidden batch(es)


CREATE TABLE event (`camtimestamp` datetime, `camname` varchar(4)) ; INSERT INTO event (`camtimestamp`, `camname`) VALUES ('2019-12-31 00:47:04', 'wls1'), ('2019-12-31 04:57:41', 'wls2'), ('2019-12-31 05:15:22', 'wls1'), ('2019-12-31 05:35:00', 'wls2'), ('2019-12-31 05:46:56', 'wls1'), ('2019-12-31 05:51:30', 'wls2'), ('2019-12-31 05:54:19', 'wls1'), ('2019-12-31 05:56:14', 'wls2'), ('2019-12-31 05:58:45', 'wls1'), ('2019-12-31 05:58:46', 'wls2'); SELECT * FROM event;
camtimestamp camname
2019-12-31 00:47:04 wls1
2019-12-31 04:57:41 wls2
2019-12-31 05:15:22 wls1
2019-12-31 05:35:00 wls2
2019-12-31 05:46:56 wls1
2019-12-31 05:51:30 wls2
2019-12-31 05:54:19 wls1
2019-12-31 05:56:14 wls2
2019-12-31 05:58:45 wls1
2019-12-31 05:58:46 wls2
 hidden batch(es)


SELECT startpit, FROM_UNIXTIME(UNIX_TIMESTAMP(startpit)+@interval) AS endpit, GROUP_CONCAT(CONCAT(camname,': ',num)) AS the_events FROM ( SELECT FROM_UNIXTIME(FLOOR(UNIX_TIMESTAMP(camtimestamp)/@interval) * @interval ) AS startpit, camname, count(*) as num FROM event, ( SELECT @interval := 3600) AS init -- where GROUP BY FLOOR(UNIX_TIMESTAMP(camtimestamp)/@interval) * @interval, camname ) AS baseview GROUP BY startpit;
Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'fiddle_UWYVAYCIMYZSHLDRVNYP.event.camtimestamp' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
 hidden batch(es)