SQL - Group By Clause

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
9,717
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Oct 16, 2009

The more data you start interrogating the more records you will return. Its always the same, you start off with basic criteria and before you know it you are referencing several tables to obtain the information your after. The questions being asked are no longer "what was the price of that product?" the questions are more generic, like "How many orders did we do this month?". The more tables you add to a query the more likley you are going to ask summary style questions of the data as you are no longer interested in specific records your more interested in trends.

To get the ball rolling on this aspect of SQL you need to start using the group by clause. This clause allows the user to summarise information in the form of aggregated values which you assign to specific fields (i.e. group to them).

This video will cover the basics of how you start grouping your data into summary information. The video will start by explaining on the small scale but then show you on multiple tables how it is achieved. This is not the end of the story with group by but this should give you the knowledge to plow into some rather meaty queries.

This is one of many videos which can be seen at PCTeach.me. Come join the gang!

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (PCTeachME)

  • Thanks ! Clear and Concise.

    Pls consider doing vids on database normalization and database design.

    Thanks again. Subscribed !

  • @theprankie Great Stuff! Make sure you check out the website as there are numerous videos on here that may have example files which you can download to follow along to. Have a look at the ssis vids some discuss denormalise vs. normailised data. If you have an idea for a topic send me an email. Thanks for your feedback!

  • Thank you very much. made it clear about GROUP BY FUNCTION.

  • @dannystud Glad I could assist!

see all

All Comments (6)

Sign In or Sign Up now to post a comment!
  • HI and thank u very much for the tutorial , i just have a question

    i want to list a column i'm not using in the GROUP BY , like if i want to list the product name but i'm grouping it by city .. how is that possible

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more