Hi guys,
Thanks for your replies.
I certainly can use VBA and ADODB object in Excel to do it. Due to performance, I wanna try to do it by SQL command in PG. However, I am not expert in PG, so I need few help from your guys. Let me to describe my question clearly as following.
The final results which I wanna get are STDDEV(a1,a2,a3,...), STDDEV(b1,b2,b3,...), ..etc. I definitely know how to use standard deviation function in PG, but the critical problem for me is how to calculate a1, a2, a3, b1, b2, b3...etc. The rule to calculate them is a little complicated because it needs not only moving window function but also few logical rules. Please see details as following or attachment. I put some colors in rules. Hopefully, it's easier for you guys to read them. Thanks
I really need the helps from your guys. Please give me some suggestions. Thanks.
Pierre