Member of the
LearnItFirst.com Video Training Network
Related Video Training Sites:
·
LearnIntegrationServices.com
·
LearnTransactSql.com
Instructor-Led Video Training for SQL Server
*
LearnIntegrationServices.com
*
LearnTransactSql.com
*
More Videobooks...
Search
My Account
Log in
More Videos
Home
FREE Video Tutorials
Subscriber Video Tutorials
Subscriptions
FAQs
Our Other Sites
About Us
Home
Free Videos
Subscriber Videos
Buy Now (Subscriptions)
More Video Websites
Search for Videos
Tag Cloud
Subscriptions
Subscribe!
Testimonials
List of Videobooks
Quick Links
About the Author
Login
FAQs
Site Map
Auto-Numbering Rows with IDENTITY Columns - How Identity Columns ...
Pt. 4 - How to View (and Understand) the Contents of the SQL Serv...
How to Return Identity Value for a Just-Inserted Row
Part 1 - An Overview of the Options Available for Upgrading and M...
Part 1 - How to Configure SQL Server 2005 for Remote Connections ...
SQL Server 2008/2005 Video Tutorial
Home
Subscriber Videos
When to Use HAVING Instead of WHERE - Aggregates, GROUP BY, and the HAVING Clause
- Training Video
Category:
Transact-SQL Basics: Queries, Stored Procedures, Functions and more
Skill Level:
300 (Intermediate)
Duration:
11:12
Size:
8.37MB
Versions/Editions Covered:
SQL Server 2005
,
SQL Server 2008
,
SQL Server 2000
Added/Updated:
May 29, 2006
The traditional areas of difficulty for SQL developers are aggregates, JOINs, and subqueries. Most people have no trouble understanding when to use COUNT instead of SUM but they get "stuck" when it comes to determining how to filter the data. Suppose you are asked to find all orders in 2006 in which customers ordered more than 5 items - how would you solve this query? Obviously you need two filters: for the date (2006) and for orders with more than 5 items. People have difficulty with this type of query however; most people would approach this query along these lines: "SELECT ... FROM Orders JOIN OrderDetails ... WHERE Year(DateOrdered)=2006 AND COUNT(*) > 5". Focus on the WHERE clause for a moment: is that right? If you aren't sure or if you think it is right, then you need to watch this video to understanding why this query must use the HAVING clause.
Tags for this video:
aggregates where clause
group by
having
<
Back
People Who Downloaded this Video Also Downloaded:
Title
Skill
Download
Part 1 - An Overview of the Default SQL Server Installation
100
Download
Part 2 - My How Things Have Changed - A Video Walk-Through of Some of the New To...
200
Download
Pt. 1 - Introduction to Stored Procedure Concepts and Common Usage
200
Download
Performance Tuning Query Tips That Everyone Should Know - Using DBCC and SET Com...
300
Download
Creating Database Diagrams in SQL Server Management Studio
200
Download
About the Instructor:
Scott Whigham is the founder of LearnItFirst.com, one of the web's most extensive video training libraries focusing on technical training. In addition to being the founder of LearnItFirst.com, Scott is an experienced consultant, trainer, and author with more than a decade of hands-on experience working with SQL Server databases, writing and debugging applications using Visual Studio, and performance tuning. Scott designed the architecture (websites, class libraries, and database) for the websites in the...
(
Scott Whigham
's full bio can be found on the
About the Author
page)
Company News
»
We're Hiring! .NET, SQL Developer Needed
»
New Videos on LearnReportingServices.com
»
New Videos on LearnSharePoint.com
»
Want Us to Sponsor Your User Group?
Home
|
About Us
|
Advertising
|
Contact Us
|
Privacy
|
System Requirements
|
Terms and Conditions
|
Testimonials
|
|
Site Map
© Copyright 2004-2007 LearnItFirst.com LLC. All rights reserved. All trademarks remain the property of their respective owners.
This site is not affiliated in any way with the Microsoft Corporation.
5/11/2008 6:42:09 PM