HomeОбразованиеRelated VideosMore From: Joes2Pros SQL Trainings

SQL Aggregation queries using Group By, Sum, Count and Having

710 ratings | 186686 views
From SQL Queries Joes 2 Pros (Vol2) ch4.1. Learn up to write aggregated queries.
Html code for embedding videos on your blog
Text Comments (40)
Asgoth (2 days ago)
damn, thanks a lot
IT Code Hub (28 days ago)
REE _cover (1 month ago)
Thank you, you are my god wtf I'm doing my assignment last minute at 4.29a.m.
Muhd Raziq (1 month ago)
aku tgk video ni sbb cikgu aku suruh
My professor told me that i couldn't use Count(amount) in my exam because it doesn't count Null , and I should use count(*) .... is this correction correct ?
Amine Slaoui (1 month ago)
thank you bro
Tasheena Nichols (1 month ago)
Nj Sato (2 months ago)
what if, you want to select grantID and display all Similar EmpID ?
Nj Sato (2 months ago)
thank you for this tutorial, but I still have a problem on how to render and display my result, but i'm still grateful. In Jesus name THANKS!
leonidas karnesis (3 months ago)
you saved me with the count I was confused
Julián Romero (3 months ago)
Thank you Moss!!!
Alpaca Lord (4 months ago)
2019 anyone?
alrishane lopez (5 months ago)
Akshay Gupta (6 months ago)
Kevin Clarke (10 months ago)
Great tutorial, stressing key concepts without giving too much detail. As an experienced SQL writer who has always struggled with aggregation queries, I especially appreciate the parts about counting values vs counting records (explains why my results sometimes didn't make sense) and the rules for deciding which fields to include in SELECT, GROUP BY and aggregation lists. Lots of practice to follow!
No Name (11 months ago)
Your voice uuuggh... but nice tut. Boy
Leo Nard (1 year ago)
thanks, really helpful for my job! ;)
Stanislav Vain (1 year ago)
Thanks! It's very useful
Poy Poy (1 year ago)
need help. for example, i have a total of 50 studentcapacity in a section or a room, and there are only 2 students in a room, how can i get the vacant? or total of vacant
Meenal Yengul (2 years ago)
what if we want to get max number of occurrences ?
Junaid Tanoli (2 years ago)
Your voice is like Mr. Chow from Hangover :D , BTW nice tutorials.
Ruel SISCO (2 years ago)
can you please show a video sample the record count value to be display in the textbox every time i click the record in the gridview using asp.net
Elgoog Skcus (2 years ago)
Why don't you get errors when you don't have all your select items in the Group By. In SQL 2012 I get errors when following your example.
Jeezy M. (2 years ago)
The reason why is because the second select field is an aggregate with SUM. You don't have to list that field under group by.
Srikanth Shenoy (2 years ago)
Awesome.. Got exactly what i was looking for!!!! Domo Arigato
Imran Shaikh (2 years ago)
Thanks sir..Really it is helpful for me...
Muhammad Aamir (2 years ago)
Hello Sir!i am facing a little bit problem in SQL.I want to add only five subjects for a single student.means there should be only five rows a for each ID..how i will add restriction on an ID,which should not add more than five subjects a student. I shall be thankful to you. Thanks in Advance
Aris Hambardzumian (3 years ago)
Thanks! It was very helpful!
Wei Lai (4 years ago)
this is great, thank you
FlareSoul69 (4 years ago)
This tutorial is absolutely fantastic... because in the real world application at your job... this deeper understanding of what it looks like just simple concepts will tremendously make your life easier when it comes to troubleshooting why your results set or rows count aren't aligning.
Marc-Étienne Paradis (4 years ago)
anis mizi (4 years ago)
Great tutorial.Learnt everything you discussed in this video.Thanks
Arjun singh (4 years ago)
it's so helpful i like it
Brandon Gow (5 years ago)
o god... this helped so much
Adrian Tse 謝嘉遜 (6 years ago)
thanks a lot!
David Gega (7 years ago)
GREAT STUFF! Very helpful
ZM Ding (7 years ago)
This is helpful
Thank you!
Michael Mittermayr (10 months ago)
Great videos! What tool are you using for recording?
plsea tell me about this query select name,date,sum(totle) from table where name='ali' group by name,date this not give sum as sum should be please tell me why

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.