From 87b5b8c0c1dc59a93ecf229f9773f60168b8383d Mon Sep 17 00:00:00 2001 From: Nanos Giorgos <74103191+Nanos1@users.noreply.github.com> Date: Fri, 13 Sep 2024 10:03:55 +0200 Subject: [PATCH] Create concatenating multiple rows.sql --- .../concatenating multiple rows.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sql-queries-5/String Concatenation and Aggregation in SQL/concatenating multiple rows.sql diff --git a/sql-queries-5/String Concatenation and Aggregation in SQL/concatenating multiple rows.sql b/sql-queries-5/String Concatenation and Aggregation in SQL/concatenating multiple rows.sql new file mode 100644 index 00000000..884289d2 --- /dev/null +++ b/sql-queries-5/String Concatenation and Aggregation in SQL/concatenating multiple rows.sql @@ -0,0 +1 @@ +USE University; SELECT department_id, STRING_AGG(CASE WHEN is_active = 'yes' THEN name ELSE NULL END, ', ') AS active_courses FROM Course GROUP BY department_id;