IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

difference between when clause and a having clause


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
arindambanerjee

New User


Joined: 30 Jun 2007
Posts: 39
Location: India

PostPosted: Sat May 10, 2008 11:31 pm
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
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat May 10, 2008 11:53 pm
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: 165
Location: Bangalore

PostPosted: Sun May 11, 2008 6:28 am
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Timestamp difference and its average ... DB2 11
No new posts Difference when accessing dataset in ... JCL & VSAM 7
No new posts To search DB2 table based on Conditio... DB2 1
No new posts What is the difference between Taskty... Compuware & Other Tools 2
No new posts Difference between VALIDPROC and CHEC... DB2 3
Search our Forums:

Back to Top