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

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -