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 to get a list of indexes of an existing table? : Sql dba

913


What does pragma mean?

970


What is index example?

949


What are the triggers associated with image items?

997


What is the use of prepared statement?

951


What is difference between sql and oracle?

1046


How can use stored procedures in sql?

1078


How exception is different from error?

969


What are the popular database management systems in the it industry?

922


what does the t-sql command ident_incr does? : Transact sql

1009


What does seeding a database mean?

889


What company owns postgresql?

960


Do we need commit after truncate?

1028


What is the difference between in and between in sql?

993


Which is faster union or join?

899