SQL > SQL????? > Order By

???? ??? SELECT ? WHERE ? ??? ?????? ???? ???? ???? ?? ??? ?????.??? ?? ???? ???? ??? ?? ???? ?????. ??? ?? ??? ?????. ??? ??? ???? ?? ????? ??? ???? ????. ?? ??? ?? ???? (ascending) ? ???? ?? ????? (descending). ?? ????? ORDER BY ? ?????? ???? ?? ??? ???? ????.

ORDER BY ? ??? ??? ????.

SELECT "???"
FROM "???"
[WHERE "??"]
ORDER BY "???" [ASC, DESC];

[] ? WHERE ?? ? ????? ??? ?????. ??? WHERE ?? ??? ?? ORDER BY ? ?? ????. ASC ? ??? ????? ?? ????? ??? ?????? ???? DESC ? ??? ?????? ?????? ??? ???? ?????. ??? ?? ?? ??? ?? ??? ASC ? ?????.

??? ???? ??? ??? ??? ???? ????. ?? ???? ORDER BY ?? ??? ??? ????(??? ??? ????? ??).

ORDER BY ""?? 1" [ASC, DESC], ""?? 2" [ASC, DESC]

?? ? ?? ?? ????? ?? ??? ??? ????? ?? ??? “??1”? ?? ????? ?? ?????. ?? ???? ???? “??1”? ??? ?? ?? “??2”? ?? ????? ?? ??? ??? ?????.

?? ?? ?? Sales ??? ????? ?? ??? ??? ?? Store_Information ???? ???? ??? ?? ? ??? ??? ????? ????? ??? ?????.

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

??? ?????,

SELECT Store_Name, Sales, Txn_Date
FROM Store_Information
ORDER BY Sales DESC;

??:

Store_Name Sales Txn_Date
Los Angeles 1500 Jan-05-1999
Boston 700 Jan-08-1999
San Francisco 300 Jan-08-1999
San Diego 250 Jan-07-1999

????? ??? ??? ??? (SQL???? ??? ???) ????? ????. SELECT ? ??? ??? 1?? ??? ??? 2,??? ?????. ? ??? ??? ?? SQL ?? ??? ?? ??? ??? ????.

SELECT Store_Name, Sales, Txn_Date
FROM Store_Information
ORDER BY 2 DESC;

SQL ?? >>
?


Copyright © 2021   1keydata.com   All Rights Reserved