Home | Submit an interview question | Filter by category | Filter by job function | Filter by company
 
Member Information
User Id
Password
 
Forgot Password
Technology Category
.NET (1202)
Languages (103)
Database (146)
Operating System (48)
Reporting (5)
Third-Party Tools (2)
Testing (91)
OOP (75)
Web Development (40)
Design Patterns (89)
General (9)
Networking (88)
Hardware (63)
Brain Exercise (2)
Others (37)
 Our Network
.NET Heaven
C# Corner
Interview Corner
Longhorn Corner
Mindcracker
VB.NET Heaven
Home » Database » Database
What is the difference between a HAVING CLAUSE and a WHERE CLAUSE?
Posted by Bhasker Das Jul 15, 2006
Viewed : 7491 times
Major Category : Database
Minor Category : SQL Server
Total Replies : 2
Become a Sponsor
 EDITORIAL ANSWER  
No Reply Yet
 ANSWERS BY USERS  
Rajender Reddy
Nov 22, 2006

when we are using group by clause to apply condition on group of rows Having clause will be used.having clause follows Group by clause.

where clause will be used for condition on single row.

where clause comes before group by clause

select empname,salary from employee where empname like '%raj%' group by salary having salary>30000


Aug 14, 2006
I don't believe there is any difference except that having clause is used if group by clause is used in the query. Otherwise I think you can use a where clause instead.
  
1
World Class ASP.NET Hosting - 3 Month Free Hosting, Click Here!
 

 Hosted by MaximumASP  |  Found a broken link?  |  Contact Us  |  Terms & conditions  |  Privacy Policy  |  Advertise with us
Current Version: 2.2009.3.2
 © 1999 - 2009  Mindcracker LLC. All Rights Reserved