How do use Having,Group by,Group function in SQL?



How do use Having,Group by,Group function in SQL?..

Answer / Rohit Kumar Chaudhary

The SQL functions `HAVING`, `GROUP BY`, and `GROUP` are used together to filter and group data in a query. Here's an example:n```sqlnSELECT department, COUNT(employee_id) AS total_employeesnFROM employeesnGROUP BY departmentnHAVING total_employees > 50;n``` In this example, the `GROUP BY` clause groups the data by department, and the `HAVING` clause filters the groups that have more than 50 employees.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

In my application I have a process which picks the scanned files (tif format) from a shared location and it links to application and shown on it.The actuall issue is that my process picks the file before it is completly written or scanned which results in displaying few parts of the image or incomplete image.I need to check if the file is not completly scanned or written then do not link it to application.Please help if any body tell me that how can i check that file is in written phase or locked through DTS.thanking you in advance

1 Answers  


List all the types of user-defined functions?

1 Answers  


As a part of your job, what are the DBCC commands that you commonly use for database maintenance?

1 Answers   HCL,


What is the difference between Procedure and Function

4 Answers   Accenture, Nagarro, TCS,


Why normalization is used?

1 Answers  


How to rename an existing column with the "sp_rename" stored procedure in ms sql server?

1 Answers  


What is openxml in sql server?

1 Answers  


What are user-defined functions (udfs) in sql server?

1 Answers  


Explain the concepts and capabilities of sql server?

1 Answers  


Can you create a logon trigger in sql server 2005 express edition?

1 Answers  


What is dbcc?

1 Answers  


Selet all the data from table where last name is n of employee

2 Answers  


Categories