column aliases in postges for calculated values
- by dubreakkk
I tried to uses aliases in postgres for this query, but postgres stops and complains that ERROR: column "subtotal" does not exist
SELECT SUM(price) AS subtotal, 
       subtotal * 3.0 AS fees,
       (subtotal + fees) AS total
  FROM cart
You cannot use aliases as part of your next column?