Diffrence between a “where” clause and a “having” claus
Submitted by: AdministratorAnswer1
The order of the clauses in a query syntax using a GROUP BY clause is as follows:
select …where..group by…having…order by…
Where filters, group by arranges into groups, having applies based on group by clause. Having is applied with group by clause.
Answer2
In SQL Server, procedures and functions can return values. (In Oracle, procedures cannot directly return a value).
The major difference with a function is that it can be used in a value assignment. Such as:
-system function
Declare @mydate datetime
Set @mydate = getdate()
-user function (where the user has already coded the function)
Declare @My_area
Set @My_area = dbo.fn_getMy_area(15,20)
Answer3
1.”where” is used to filter records returned by “Select”
2.”where” appears before group by clause
3.In “where” we cannot use aggregate functions like where count(*) >2 etc
4.”having” appears after group by clause
5.”having” is used to filter records returned by “Group by”<
6.In”Having” we can use aggregate functions like where count(*) >2 etc there are two more
Submitted by: Administrator
The order of the clauses in a query syntax using a GROUP BY clause is as follows:
select …where..group by…having…order by…
Where filters, group by arranges into groups, having applies based on group by clause. Having is applied with group by clause.
Answer2
In SQL Server, procedures and functions can return values. (In Oracle, procedures cannot directly return a value).
The major difference with a function is that it can be used in a value assignment. Such as:
-system function
Declare @mydate datetime
Set @mydate = getdate()
-user function (where the user has already coded the function)
Declare @My_area
Set @My_area = dbo.fn_getMy_area(15,20)
Answer3
1.”where” is used to filter records returned by “Select”
2.”where” appears before group by clause
3.In “where” we cannot use aggregate functions like where count(*) >2 etc
4.”having” appears after group by clause
5.”having” is used to filter records returned by “Group by”<
6.In”Having” we can use aggregate functions like where count(*) >2 etc there are two more
Submitted by: Administrator
Read Online Database Administrator (DBA) Job Interview Questions And Answers
Top Database Administrator (DBA) Questions
☺ | Name three advisory statistics you can collect. |
☺ | How would you determine who has added a row to a table? |
☺ | What are the ways to monitor the performance of the report? |
☺ | What DBA activities did you to do today? |
☺ | What is the maximum no of chars the parameter can store? |
Top Databases Programming Categories
☺ | RDBMS Interview Questions. |
☺ | SQL Interview Questions. |
☺ | SSRS Interview Questions. |
☺ | Database Administrator (DBA) Interview Questions. |
☺ | Sybase Interview Questions. |