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. 1716874 fiddles created (23891 in the last week).

CREATE TABLE t (`Id` int, `customer_id` int, `customer_name` varchar(4), `Date` varchar(10), `Books_bought` varchar(13)) ;
 hidden batch(es)


INSERT INTO t (`Id`, `customer_id`, `customer_name`, `Date`, `Books_bought`) VALUES (1, 1, 'Alex', '08.06.2017', 'HarryPotter1'), (2, 1, 'Alex', '08.06.2017', 'Harry Potter2'), (3, 1, 'Alex', '09.06.2017', 'PHP 7'), (4, 2, 'Sam', '10.06.2017', 'SQL') ;
 hidden batch(es)


SELECT customer_id, customer_name, `Date`, GROUP_CONCAT(`Books_bought` ORDER BY `Books_bought` SEPARATOR ', ') AS books FROM t GROUP BY customer_id, `Date` ORDER BY `Date`, customer_id ;
customer_id customer_name Date books
1 Alex 08.06.2017 Harry Potter2, HarryPotter1
1 Alex 09.06.2017 PHP 7
2 Sam 10.06.2017 SQL
 hidden batch(es)