-- Datenbank für Tabelle `bug`
------------------------------
CREATE DATABASE `test`;
USE `test`;


-- Tabellenstruktur für Tabelle `bug`
-------------------------------------
CREATE TABLE `bug` (
  `id` int(11) NOT NULL,
  `name` varchar(10) NOT NULL,
  `group` tinyint(4) NOT NULL,
  `value` varchar(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


-- Daten für Tabelle `bug`
-------------------------------------
INSERT INTO `bug` (`id`, `name`, `group`, `value`) VALUES
(1, 'anton', 1, 'A'),
(2, 'berta', 2, 'B'),
(3, 'dora', 3, NULL);


\! echo "… WHERE group = 2 …"
-- BUG
-------------------------------------
SELECT DISTINCT
      `group`,
      IFNULL(GROUP_CONCAT(`value`), 1) as 'values'
FROM  `bug`
WHERE `group` = 2
GROUP BY `id`
ORDER BY `name`;

-- Clean Up
-----------
DROP DATABASE `test`;
