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.


Comments

Popular posts from this blog

Glib GIOChannel -

delphi - When I encode/decode SMS PDU (GSM 7 Bit) user data, do I need prepend the UDH first? -

python - Obscure curses error message when creating a sub window -