WHERE and HAVING

Codes here !

Moderators: egami, macek, gesf

Post Reply
sureshraina

Fri Jul 22, 2011 7:24 pm

Hi guys give answer.

Difference between WHERE and HAVING Clause?

Thks.
User avatar
gesf
Moderator
Moderator
Posts: 1716
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden
Contact:

Sat Jul 23, 2011 8:35 am

Hey sureshraina,

You can find the answer, in the MySQL Manual, for SELECT.
butchfirefox
New php-forum User
New php-forum User
Posts: 6
Joined: Thu Aug 04, 2011 7:44 pm

Fri Aug 05, 2011 1:00 am

i think it could be best explained by example

in table user i have fields cUserID, cUserName
i will issue a query like this:

select cUserID, cUserName, count(cUserID) nCount
from user
where cUserID = '00001'
having nCount > 1

can u see the difference?

if not:

cUserID is a field in the table
while nCount is not

hope i explained it clearly
Post Reply