In the last episode you saw that I studied TSQL for the new project, today I had some issues with the machine, connection, permissions and SQL Server. Now everything is well set up and I could keep studying some TSQL! The command that I studied today was Group By, it is used in conjunction with the aggregate functions to group the result-set by one or more columns.

So let’s take a look at some queries that I found really good to know about…

Group By

First, a simple statement to know the subtotal of each sale… Easy!

Group By


You can also do it by multiple groups.

Group By

Using WHERE…

Group By

You can group by an expression if the expression does not include aggregate functions and then Order By cz-lekarna.com.

TSQL Commands

I want to put everything that I learn in practice, the best is when you get a project, you use everything you learned and then you learn so much faster.

Leave a Comment

Your email address will not be published. Required fields are marked *