I have the same question as #1895500, but with PostgreSQL not MySQL.
How can I define a view that has a calculated field, for example:
(mytable.col1 * 2) AS times_two
... and create another calculated field that's based on the first one:
(times_two * 2) AS times_four
...?
Konrad Garus :
Depending on how heavy the formla is, you could use a subquery:\n\nselect inner.*, times_two * 2 from\n(select mycol * 2 as times_two from table) sub\n\n\nOr rewrite the computation:\n\nselect mycol * 2, mycol * 2 * 2 from table\n",
2010-03-05T09:56:42