clear markdown help donate comments/suggestions/bugs a leap of faith?
clear markdown donate comments/suggestions/bugs a leap of faith?
By using dbfiddle, you agree to license everything you submit by Creative Commons CC0

CREATE TABLE tab(NR VARCHAR(100), GRD VARCHAR(100), DT DATE); INSERT INTO tab SELECT '00000000000000000001' AS NR, N'06' AS GRD, DATE '2013-01-01' AS DT UNION ALL SELECT '00000000000000000001' ,N'06', DATE '2013-01-01' UNION ALL SELECT '00000000000000000001' ,N'21', DATE '2013-01-01' UNION ALL SELECT '00000000000000000002' ,N'06', DATE '2013-01-01' UNION ALL SELECT '00000000000000000002' ,N'21', DATE '2013-01-01' UNION ALL SELECT '00000000000000000004' ,N'01', DATE '2013-03-31';
6 rows affected

SELECT NR, ARRAY_AGG(GRD) AS grds FROM tab GROUP BY NR
nr grds
00000000000000000001 {06,06,21}
00000000000000000002 {06,21}
00000000000000000004 {01}