Author: Shameer
•7:24 AM
The GROUP BY statement is used in conjunction with the aggregate functions to group the result-set by one or more columns.

Main Table


1.     SELECT Customer_Name, SUM (Order_Price)
           FROM customer
    GROUP BY Customer_Name



2.      SELECT Customer_Name, AVG (Order_Price)
            FROM customer
    GROUP BY Customer_Name



3.      SELECT Customer_Name, SUM (Order_Price), Order_Date
            FROM customer
    GROUP BY Customer_Name, Order_Date



4.      SELECT Customer_Name, SUM (Order_Price) , Order_Date
           FROM customer
         WHERE Cus_Id=3
    GROUP BY Customer_Name, Order_Date



5.      SELECT Customer_Name, SUM (Order_Price) 
            FROM customer
    GROUP BY Customer_Name, Order_Date
    ORDER BY Customer_Name DESC


This entry was posted on 7:24 AM and is filed under . You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.