i have table in postgresql database looks this: stid | e5 | e10 | diesel | date -----+------+------+--------+------------------------ e850 | 1300 | 1400 | 1500 | 2016-05-02 05:30:01+02 e850 | 1400 | 1500 | 1700 | 2016-05-02 08:30:01+02 e850 | 1300 | 1400 | 1500 | 2016-05-02 21:00:01+02 e850 | 1200 | 1300 | 1350 | 2016-05-03 10:30:01+02 e850 | 1300 | 1400 | 1500 | 2016-05-03 21:00:01+02 954d | 1200 | 1100 | 1300 | 2016-05-02 03:30:01+02 954d | 1300 | 1100 | 1300 | 2016-05-02 15:00:01+02 954d | 1400 | 1800 | 1400 | 2016-05-02 22:30:01+02 954d | 1700 | 1900 | 1400 | 2016-05-03 09:30:01+02 954d | 1500 | 1900 | 1200 | 2016-05-03 23:30:01+02 so have unique id's (stid), prices (e5,e10,diesel) , timestamp (date) indicates when price introduced. want calculate average price per day , stid, weighted duration price charged. , want take period between 8 , 8 pm account. to calculate weighted average price of e5 stid e850 , date 2016-05-02 between 8 , 8 pm follo...
Comments
Post a Comment