Question:
sql STATEMENT HELP ????
Shri G
2008-08-30 14:54:58 UTC
How would write this as an sql statement???

Show all columns from the StockItem table in descending Selling Price sequence.
Where more than 1 item has the same selling price, ensure that the items are listed in
ascending Description sequence.

Select *
From Stock item table.....????
Three answers:
Nick B
2008-08-30 15:06:26 UTC
You can use this SQL statement:



SELECT * FROM StockItem ORDER BY SellingPrice DESC, DESCRIPTION, ASC



You can look here for more information on the ORDER BY statement.

http://www.w3schools.com/sql/sql_orderby.asp
Serge M
2008-08-31 18:31:11 UTC
SELECT *

FROM StockItem

ORDER BY SellingPrice DESC, Description
TheMadProfessor
2008-08-31 15:18:31 UTC
Nick's answer is almost correct, just that there should not have been a comma between description and ASC (ASC could probably have been omitted entirely for that matter, as that's the default).


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...