I
I
Ivan Driuk2018-03-18 23:48:08
PostgreSQL
Ivan Driuk, 2018-03-18 23:48:08

How to do complex arithmetic in psql console?

Please tell me how to do something like in psql

select (select sum(price) from spends) as total, (select max(time)-min(time) from spends) as period, total/period from spends
?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yerlan Ibraev, 2018-03-20
@IDriuk

with to help you :-)

X
x67, 2018-03-19
@x67

Do you really want us to read this one line sql centipede?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question