Say I have the following SQL:
SELECT amount, amount*.1, (amount*1)+3, ((amount*1)+3)/2, (((amount*1)+3)/2)+37 FROM table
Instead of repeating that identical code every time, I really want to be able to do something like this:
SELECT amount, amount*.1 AS A, A+3 AS B, B/2 AS C, C+37 AS D, FROM table
But this code doesn't work.
So, is there another way to avoid duplication in the working query that I have?