Ordering sql query results
- by user343409
My sql query gives the columns:
product_id (which is an integer)
pnl (which is float - can be negative)
I get more than 100 rows.
I want to filter out the top 40 rows based on abs(pnl).
But the results should be ordered by pnl column only and not by abs(pnl).
I want to do this for MSSQL 2005.
Is there a way to do this?