天天看點

PostgreSQL Oracle 相容性之 - RATIO_TO_REPORT 分析函數

postgresql , oracle , ratio_to_report , 分析函數

oracle的分析函數ratio_to_report()是用于計算目前值在分組内的占比的

postgresql也支援視窗查詢,但是沒有提供這個分析函數,不過我們知道它是幹什麼的,當然就知道如何寫sql來實作同樣的目的了。

<a href="http://stackoverflow.com/questions/35976390/postgres-ratio-to-report-function">http://stackoverflow.com/questions/35976390/postgres-ratio-to-report-function</a>

<a href="https://docs.oracle.com/cd/b19306_01/server.102/b14200/functions124.htm">https://docs.oracle.com/cd/b19306_01/server.102/b14200/functions124.htm</a>