I got a query to calculate the percentage as ,
Select votes, rating, votes/sum(votes) as percentage
But I want to take the values from two different tables. I tried
Select elec.sum(votes) from elec, stat.sum(rating) from stat where year=2009, elec.sum(votes)/tat.sum(rating) as percentage;
This doesn't work.