title: Difficulty converting GROUP_CONCAT query from MySQL to H2 with DISTINCT keyword
body: <p>I am attempting to get a query that was previously used with MySQL to work with H2. The query does exactly as needed in MySQL (when the double quotes are replaced with backticks). It is as follows:</p>
  
  <pre><code>SELECT GROUP_CONCAT(DISTINCT "Id" ORDER BY "Id" SEPARATOR ' ') "Id", 
          GROUP_CONCAT(DISTINCT "Course" ORDER BY "Id" SEPARATOR ' ') "Course",
          GROUP_CONCAT("Day/s" ORDER BY "Id" SEPARATOR ' ') "Day/s", 
          "Sect", 
          "Class Nbr" 
  FROM SAMPLE 
  GROUP BY "Class Nbr", "Sect"
  </code></pre>
  
  <p>The query in reality is programmatically generated, but that example captures what its purpose. Yes I am aware that using quotes around all column and table names to accommodate potential spaces is not ideal, but it is the approach that I have to work with at the moment.</p>
  
  <p>The problem is that H2 does not seem to be interpreting the <code>DISTINCT</code> keyword, at least not like how MySQL was interpreting it. In H2, it is concatenating all aggregated values, regardless of whether they are distinct. For example, following the above example query, two duplicate <code>Id</code> entries get concatenated, which is not the behavior that I would like.</p>
  
  <p>Running the aforementioned <code>SELECT</code> query on the following table setup illustrates the problem:</p>
  
  <pre><code>CREATE TABLE SAMPLE("Id" VARCHAR(255), "Course" VARCHAR(255), "Day/s" VARCHAR(255), "Sect" VARCHAR(255), "Class Nbr" VARCHAR(255));
  INSERT INTO SAMPLE VALUES (1, 'class1', 'M W F', 1134, 553);
  INSERT INTO SAMPLE VALUES (2, 'class1', 'T R', 1134, 553);
  INSERT INTO SAMPLE VALUES (3, 'class2', 'T R', 1111, 444);
  </code></pre>
  
  <p>The result is:</p>
  
  <pre><code>Id  |    Course     |   Day/s   | Sect | Class Nbr
  ---------------------------------------
   3  |    class2     |    T R    | 1111 | 444
  ---------------------------------------
  1 2 | class1 class1 | M W F T R | 1134 | 553
  </code></pre>
  
  <p>Whereas I'd like the result to be, as it was in MySQL:</p>
  
  <pre><code>Id  | Course |   Day/s   | Sect | Class Nbr
  ---------------------------------------
   3  | class2 |    T R    | 1111 | 444
  ---------------------------------------
  1 2 | class1 | M W F T R | 1134 | 553
  </code></pre>
  
  <p>Any help porting this query over to H2 would be greatly appreciated.</p>