Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

query to retrive the employees whose sal is greater than avg
sal

Answer Posted / viren

since we are using aggregate function AVG, we have to use
GROUP BY, HAVING clause.

select empName, avg(sal) from employees group by sal having
sal > avg(sal) order by empName;

Is This Answer Correct ?    4 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I view output in sql developer?

1067


Explain exception handling in pl/sql?

1021


Which sorts rows in sql?

1001


What is package in pl sql with an examples?

1020


How to start oracle sql developer?

1014


What is equi join in sql?

1057


What are the rules to be applied to nulls whilst doing comparisons?

1311


What are inner and outer joins examples of both?

940


Can we create view in stored procedure?

944


Why do we use procedures?

941


Does sql full backup truncate logs?

1007


explain what is mysql? : Sql dba

1065


What is a left inner join?

995


What are all different types of collation sensitivity?

1015


How to fetch alternate records from a table?

1211