Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> How to compare values within a table - SQL
MyTable
id year month amount
1 1999 3 10 1 1999 4 10 1 1999 5 10 2 1999 3 10 2 1999 4 25 3 1999 3 10 3 1999 5 10
How to list out the IDs when (the amount of month 3 - the amount of month 4) > 50%?
With the above data, I want to have the following output:
id
==
2
3
--
Best regards,
Received on Sat Jun 26 1999 - 11:39:11 CDT