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

What is sqlca in powerbuilder?

1014


What is linq to sql?

1132


what is online transaction processing (oltp)? : Sql dba

994


Can we use join in subquery?

1095


Why do we use view in sql?

960


What is trigger explain it?

1015


what is a unique key ? : Sql dba

1091


Can we use ddl statements in stored procedure sql server?

1007


What are user defined functions?

1016


What is left join in postgresql?

1046


what is cursor and its type, what is ref cursor write a syntax to pass ref cursor into procedure out fucntion and call the procedure

1749


Why is sql better than hql?

991


What are the uses of sysdate and user keywords?

1103


What are the different sql commands?

1073


what is the difference between rownum pseudo column and row_number() function? : Sql dba

1079