From 6899619c83b6ab7e8d9c7d9cfb6f6c630053174a Mon Sep 17 00:00:00 2001 From: Vhonani-Nelwamondo <90554373+Vhonani-Nelwamondo@users.noreply.github.com> Date: Mon, 9 Dec 2024 09:14:47 +0200 Subject: [PATCH] Update 2-how-we-style-our-sql.md Group by column names --- .../docs/best-practices/how-we-style/2-how-we-style-our-sql.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/best-practices/how-we-style/2-how-we-style-our-sql.md b/website/docs/best-practices/how-we-style/2-how-we-style-our-sql.md index 35e025faf3..683b319c23 100644 --- a/website/docs/best-practices/how-we-style/2-how-we-style-our-sql.md +++ b/website/docs/best-practices/how-we-style/2-how-we-style-our-sql.md @@ -25,7 +25,7 @@ id: 2-how-we-style-our-sql - 🔙 Fields should be stated before aggregates and window functions. - 🤏🏻 Aggregations should be executed as early as possible (on the smallest data set possible) before joining to another table to improve performance. -- 🔢 Ordering and grouping by a number (eg. group by 1, 2) is preferred over listing the column names (see [this classic rant](https://www.getdbt.com/blog/write-better-sql-a-defense-of-group-by-1) for why). Note that if you are grouping by more than a few columns, it may be worth revisiting your model design. +- 🔢 Ordering and grouping by column names and not Group by 1,2,3 this works on adhoc sql queries and not SQL queries you use in production. ## Joins