SQL > SQL????? > Having

??? ???? ??? ??? ?? ??? ?????? ?? ?? ??? ????? ?? ??? ????$1,500? ?? ???? ????????. ?? ????? WHERE ?????? ???? ????. ?? ??? ???? ????? SQL? ??? HAVING ?????? ????? ??? ? ??????? ??? ???? ????. HAVING ?? ?? SQL ?? ???? ?????. HAVING ?? ???SQL ? ??? GROUP BY ?? ???? ???? ????. HAVING ? ??? ??? ????:

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

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

Store_Information ?? ? ???,

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
HAVING SUM(Sales) > 1500;

??:

Store_Name SUM(Sales)
Los Angeles 1800

SQL ?? >>
?


Copyright © 2021   1keydata.com   All Rights Reserved