6.9 slide #37

Note: The default sort order is ASC-don’t have to be specified.

/* slide#37 Sort order: ass and desc */
SELECT  * 
FROM    ORDER_ITEM 
ORDER BY  Price desc;
TABLE6.10: 7 records
OrderNumber SKU Quantity Price ExtendedPrice
3000 100200 1 300 300
1000 201000 1 300 300
1000 202000 1 130 130
2000 101100 4 50 200
3000 101100 2 50 100
2000 101200 2 50 100
3000 101200 1 50 50
/* slide#37 Sort order: ass and desc */
SELECT  * 
FROM    ORDER_ITEM 
ORDER BY  Price desc, ordernumber asc;
TABLE6.11: 7 records
OrderNumber SKU Quantity Price ExtendedPrice
1000 201000 1 300 300
3000 100200 1 300 300
1000 202000 1 130 130
2000 101100 4 50 200
2000 101200 2 50 100
3000 101100 2 50 100
3000 101200 1 50 50