N
N
NubasLol2019-08-20 19:56:58
PostgreSQL
NubasLol, 2019-08-20 19:56:58

Is it possible to refer to the computed value?

Let's say there is a table. colum1 and colum 2. I need to display colum3 for it, with the condition if colum1 > 0, then colum3 = colum1, otherwise it is equal to colum3 but the previous line

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
d-stream, 2019-08-20
@d-stream

If you do not need to build an index on this calculated field, you can get by with case.
The only question is - what is meant by "but the previous line")
For the order of select * from will be slightly different from select * from where... order by...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question