What is the query to retrieve first name and sum of order qty for order sum greater than 25, and group the order sum by first name.?

 Posted by Bharathi Cherukuri on 4/30/2012 | Category: Sql Server Interview questions | Views: 1183 | Points: 40
Answer:

The query to retrieve first name and sum of order qty for order sum greater than 25, and group the order sum by first name is as follows:

SELECT FIRSTNAME,SUM(QTY)  

FROM orders
GROUP BY FIRSTNAME
HAVING SUM(QTY)>25;


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response