SQL > SQL????? > Group By

?? ??? ??? ????. ??? SUM? ??????? ?? Sales (???)???? ?????!?? ?? ??(store_name) ? ??? (sales)? ???? ? ???? ??? ????? ?? ????? ??? ??? ????. ??, ??? store_name ? Sales ? ??? ?? ?????.?? ??sales ? ?? ??store_name ? ?? ??? ??????? ?????. ? ???:

SELECT "??1", SUM("??2")
FROM "???"
GROUP BY "??1";

?? ????

Store_Information ??
Store_NameSalesTxn_Date
Los Angeles150005-Jan-1999
San Diego25007-Jan-1999
Los Angeles30008-Jan-1999
Boston70008-Jan-1999

??? ?????,

SELECT Store_Name, SUM (Sales)
FROM Store_Information
GROUP BY Store_Name;

??:

Store_Name SUM (Sales)
Los Angeles 1800
San Diego 250
Boston 700

?? ??? ??? ???? ?? ??? ??? ??? ?? ??? ??? ?? GROUP BY ?????? ???? ???. ?? ???? ??? GROUP BY ? ?? ?? ??? ?? ?? ????? ???. ?? ??? ??? ??? ???? ?? ???? GROUP BY ?? ??? ???.

SQL HAVING >>
?


Copyright © 2021   1keydata.com   All Rights Reserved