oracle - Getting the percentage in sql query -


i need find percentage of assistants working specified professors total number of professors.

so far i've made sql order list of assistants working specified professors, when try divide number gives me error.

this wrote:

select count(*)  professoren p, assistenten  a.boss = p.persnr , p.name in ('sokrates', 'russel', 'augustinus'); 

i tried this, gives me error:

select count(*)/(select count(*) assistenten) professoren p, assistenten  a.boss = p.persnr , p.name in ('sokrates', 'russel', 'augustinus'); 

use explicit join syntax , 1 approach use cross join , total count , value can used percentage.

select count(*)/t.totalcount professoren p join assistenten  a.boss = p.persnr  , p.name in ('sokrates', 'russel', 'augustinus') cross join ( select count(*) totalcount assistenten ) t 

Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -