--Question 8c 4 columns from Invoices table with alias' and two calculated columns and filter and sort with ROWNUM
Expand|Select|Wrap|Line Numbers
- SELECT invoice_number AS "Number", invoice_total AS "Total", payment_total + credit_total AS "Credits", invoice_total - (payment_total + credit_total) AS "Balance Due"
- FROM invoices
- WHERE invoice_total - (payment_total + credit_total) > 500
- ORDER BY 4 DESC
- (SELECT *
- WHERE ROWNUM = 10)
Expand|Select|Wrap|Line Numbers
- SELECT invoice_number AS "Number", invoice_total AS "Total", payment_total + credit_total AS "Credits", invoice_total - (payment_total + credit_total) AS "Balance Due"
- FROM invoices
- WHERE invoice_total - (payment_total + credit_total) > 500
- ( SELECT * from invoices
- ORDER BY invoice_total - (payment_total + credit_total) DESC
- );
- WHERE ROWNUM = 10;