Can Having clause be used without Group by clause?
Answers were Sorted based on User's Feedback
Answer / phani
we can use, but select columns and having columns should
use with aggregare functions
ex:
select max(empid), min(marks)
from employee
having max(empid_id)>100
| Is This Answer Correct ? | 72 Yes | 16 No |
Answer / debasish
we can use having clause without group bu clause .but it
will act as where clause
| Is This Answer Correct ? | 68 Yes | 33 No |
Answer / sumathy
HAVING Clause
Specifies a search condition for a group or an aggregate.
HAVING is usually used with the GROUP BY clause. When GROUP
BY is not used, HAVING behaves like a WHERE clause.
Reference:
http://msdn.microsoft.com/en-us/library/aa259187
(SQL.80).aspx
| Is This Answer Correct ? | 30 Yes | 3 No |
Answer / pradip jain
select max(empno) from dbo.Employee having count(EmpNo)=9
it has no meaning so it will show zero record
| Is This Answer Correct ? | 17 Yes | 6 No |
Answer / shailesh yadav
Yes HAVING caluse can be use without GROUP BY. the SQL HAVING clause is often used with the GROUP BY clause. If the GROUP BY clause is omitted, the MySQL HAVING clause behaves like the WHERE clause. Notice that the MySQL HAVING clause applies the condition to each group of rows, while the WHERE clause applies the condition to each individual row.
| Is This Answer Correct ? | 6 Yes | 2 No |
Answer / anilreddy
No,we can not use.If there is Having it must followed by Group By
| Is This Answer Correct ? | 6 Yes | 52 No |
What is indexed views? plz explain with example?
Explain mixed authentication mode of sql server?
Can you explain various data region available in ssrs with their use?
how to retrive only second row from table in sql server 2000?
1.what is stored procedure?Its significance with example? 2.Explain about index with syntax and example? plz do reply.........
in how many ways we can use count()
What is precedence constraint?
What are Row versions of DataRow?
two tables with table name ship(name,year) and battle (name,year),how to find the latest added year in the table ship
What is a full text index?
write a query for list of owner who are having multiple bikes in below table 1 shanker pulsar 2 shanker Honda 3 shanker car 4 Balu pulsar 5 Balu Honda 6 Balu car 7 Shyam pulsar 8 Jaya Honda 9 Deepa car 10 vasu car
What area unit the various kinds of info compression introduced in sql server 2008?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)