Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
difference between when clause and a having clause

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
Author Message
arindambanerjee

New User


Joined: 30 Jun 2007
Posts: 5
Location: noida

PostPosted: Sat May 10, 2008 11:31 pm    Post subject: difference between when clause and a having clause
Reply with quote

hii,
can any one explain me the difference between where clause and a having clause with an example. i mean where to use each of them and in which situations other than the fact that we need to use groupby in case of having.
i have gone through the materials but i couldn't find the exact difference and the exact circumstances in which we should use.

thanks in advance.[/i]
Back to top
View user's profile Send private message
References
PostPosted: Sat May 10, 2008 11:31 pm    Post subject: Re: difference between when clause and a having clause Reply with quote

dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 7903
Location: 221 B Baker St

PostPosted: Sat May 10, 2008 11:53 pm    Post subject:
Reply with quote

Hello,

Usually we have a requirement and look for a solution. You appear to have found some solution and are trying to look for a requirement to use it.

WHERE specifies one or more columns. HAVING specifies a result table.

Are you familiar with the "IBM Manuals" link at the top of the page? Several sets of DB2 documentation are available there. These (as well as the other sets of documentation) are your friend icon_smile.gif

Here's a link to what i believe will help you:http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/dsnsqj10/4.2.5?

If you have a requirement, and post it, someone may have suggestions.
Back to top
View user's profile Send private message
the_gautam

Active User


Joined: 05 Jun 2005
Posts: 168
Location: Bangalore

PostPosted: Sun May 11, 2008 6:28 am    Post subject:
Reply with quote

WHERE clause is used to select the matching rows according to a condition.

HAVING clause is used to select the matching rows according to a condition to form a GROUP.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1