I think what I need to do can be done using one query, but I'm really not sure - and I'd like to avoid performing a query and then sorting the resultant array if possible.
Basically, I have one table, which includes the following columns:
product_name, price, sold
From these columns, I'd like to do the following:
- Select the highest 20 values from the
'sold' column DESC
; - Order the 20 results by
price ASC
.
Sounds so simple, but can't figure out how to accomplish this to save my life, and SQL is not my strong point. If anyone could help out, it would be appreciated!