oracle sqldeveloper - performance testing in sql using with clause -


i have 2 sql shown below

option 1:     select sum(amount)/case when sum(amount) = 0 100 else sum(amount) table_01;   option 2: sample_01 ( select sum(amount) amount table_01 )  select amount/case when amount =0 100 else amount sample_01; 

which option practice in terms of performance perspective , why best ?. felt option 2 best because doing sum once , call again , again instead of doing sum again , again in option 2 . help.


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -