Question:
What is a basic difference between having and where clause?
Answer:
WHERE clause will restrict the no of rows to be retrieved while where HAVING clause will restrict groups. Source: CoolInterview.com
Answered by: Madhavi | Date: 1/24/2008
| Contact Madhavi
HAVING clause is used to restrict the group functions. WHERE clause is used to restrict the rows returned by the query. Source: CoolInterview.com
Answered by: Aniket Govilkar | Date: 1/29/2008
| Contact Aniket Govilkar
Where clause is used to filter individual rows but Having clause is used to filter group of rows. Source: CoolInterview.com
Answered by: Ankit Vohra | Date: 1/30/2008
| Contact Ankit Vohra
where clause is used in single row functions and having clause is used in multi row functions Source: CoolInterview.com
Answered by: GOMATHI | Date: 2/7/2008
| Contact GOMATHI
Where clause is used to enforce condition on select statement and it comes prior to group by clause. Having clause is used to enforce condition on group function and it comes after the group by clause. Using where clause we can elimiate rows before it going to group and having clause used to restrict rows of the group and applies on group function. Source: CoolInterview.com
Answered by: Bindhu balan | Date: 2/21/2008
| Contact Bindhu balan
basically, having and where clause use for filter purpose.where clause use for restrict the particular rows. Having clause used to restrict the particular groups that means, using having clause we can restrict which groups to be shown. Source: CoolInterview.com
Answered by: sudipta das | Date: 2/27/2008
| Contact sudipta das
The where can't be used to filter the records based on a group function where as a having clause can be used. Source: CoolInterview.com
Answered by: sirisha | Date: 3/3/2008
| Contact sirisha
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|