SQL Having By

The where clause restricts the rows before it is grouped by the group by clause where as the having clause restricts groups. When we use the having clause then the server performs the following steps:


Select dept-id, max(emp-salary)
From employee
Group by dept-id
Having max(emp-salary) > 10000 ;

The above example will display the department id and maximum salary for those department whose maximum salary is greater than 10000.
Note:-it is also possible to specify a group function with the having clause that is not in the select list.


Popular Links

Contact Us

address Plot No-741,2ND Floor
Opp. Bhagabati Temple,Jayadev Vihar
      Email: info@silantechnology.com
      Phone: 0674-2361252
39877, sundale dr, apt#101, Fremont, California 94538, USA
       Phone: +1(262)388-7619

facebook twitter google linked in

© 2018 Silan Technology. All Rights Reserved