sql - PostgreSQL reusing computation result in select query -
for example using sql can do: select (a+b) c table c < 5 , (c*c+t) > 100; is there way using postgres? this alternative might use: select foo.c ( select (a+b) c table ) foo foo.c < 5 , (foo.c*foo.c+t) > 100 from performance point of view, think it's not optimal solution (because of lack of clause of foo subquery, hence returning table records). don't know if postgresql query optimization there.