Answer the question
In order to leave comments, you need to log in
How to insert a fraction in partition by?
I need to calculate the average value according to this formula:
sum(rashody)/count(distinct data_prikaza_)
And then this field including others is grouped in partition by, however I get an error:
not a single group group function
I used avg before and everything was fine, but now it does not fit
Perhaps it is worth checking for 0 denominator
Answer the question
In order to leave comments, you need to log in
select sum(rashody)/count(distinct data_prikaza_) over(partition by gosb) from erp_trips
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question