Posts Topics Forums Images
Search videos from message boards Videos Search messages from microblogs Microblogs Search messages from imdb.com Imdb Search messages from yuku.com Yuku Search messages from lefora.com (free forums) Lefora
My account: Login | Sign Up
Loading... 

Thread: How to get the percentage??

Started 1 month, 2 weeks ago by pritaeas
Help with Code Tags MySQL Syntax ( Toggle Plain Text ) SELECT elec.sum ( votes ) as votes, stat.sum ( rating ) as rating, votes/rating as percentage FROM elec, stat WHERE YEAR = 2009 SELECT elec.sum(votes) as votes, stat.sum(rating) as rating, votes/rating as percentage FROM elec, stat WHERE YEAR=2009...
Site: www.daniweb.com - IT Tech Talk  www.daniweb.com - IT Tech Talk - site profile
Forum: MySQL  MySQL - forum profile
Total authors: 3 authors
Total thread posts: 3 posts
Thread activity: no new posts during last week
Domain info for: daniweb.com

Other posts in this thread:

urtrivedi replied 1 month, 2 weeks ago
Following query should work I m assuming that both table contains year column Help with Code Tags MySQL Syntax ( Toggle Plain Text ) SELECT sum ( elec.votes ) /sum ( stat.rating ) as percentage FROM elec INNER JOIN on elec. YEAR =stat. YEAR WHERE stat. YEAR = 2009 select sum(elec.votes)/sum(stat.rating) as percentage from elec ...

jrosh replied 1 month, 2 weeks ago
• • • • Originally Posted by urtrivedi Following query should work I m assuming that both table contains year column Help with Code Tags MySQL Syntax ( Toggle Plain Text ) SELECT sum ( elec.votes ) /sum ( stat.rating ) as percentage FROM elec INNER JOIN on elec. YEAR =stat. YEAR WHERE stat. YEAR = 2009...

 

Top contributing authors

Name
Posts
pritaeas
1
user's latest post:
How to get the percentage??
Published (2009-11-12 04:23:34)
Help with Code Tags MySQL Syntax ( Toggle Plain Text ) SELECT elec.sum ( votes ) as votes, stat.sum ( rating ) as rating, votes/rating as percentage FROM elec, stat WHERE YEAR = 2009 SELECT elec.sum(votes) as votes, stat.sum(rating) as rating, votes/rating as percentage FROM elec, stat WHERE YEAR=2009 Only thing I'm not sure about is the YEAR = 2009 in the where.
urtrivedi
1
user's latest post:
How to get the percentage??
Published (2009-11-12 04:23:34)
Following query should work I m assuming that both table contains year column Help with Code Tags MySQL Syntax ( Toggle Plain Text ) SELECT sum ( elec.votes ) /sum ( stat.rating ) as percentage FROM elec INNER JOIN on elec. YEAR =stat. YEAR WHERE stat. YEAR = 2009 select sum(elec.votes)/sum(stat.rating) as percentage from elec inner join on elec.year=stat.year where stat.year=2009
jrosh
1
user's latest post:
How to get the percentage??
Published (2009-11-12 06:23:34)
• • • • Originally Posted by urtrivedi Following query should work I m assuming that both table contains year column Help with Code Tags MySQL Syntax ( Toggle Plain Text ) SELECT sum ( elec.votes ) /sum ( stat.rating ) as percentage FROM elec INNER JOIN on elec. YEAR =stat. YEAR WHERE stat. YEAR = 2009 select sum(elec.votes)/sum(stat.rating) as percentage from elec inner join...

Related threads on "www.daniweb.com - IT Tech Talk":

Related threads on other sites:

Thread profile page for "How to get the percentage??" on http://www.daniweb.com. This report page is a snippet summary view from a single thread "How to get the percentage??", located on the Message Board at http://www.daniweb.com. This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity