paultaylor Posted October 4, 2007 Share Posted October 4, 2007 Hi All, I have a table with three columns emp_code, emp_job, emp_result holding multiple lines of data for each ‘emp_code’ I want to find the ranking based on SUM of 'emp_result' / COUNT 'emp_job' WHERE 'emp_code' = n. Can this be done only in SQL ??? Thanks, Paul Link to comment https://forums.phpfreaks.com/topic/71808-select-a-ranking-from-sum-count/ Share on other sites More sharing options...
Barand Posted October 4, 2007 Share Posted October 4, 2007 SELECT AVG(emp_result) FROM mytable WHERE emp_code = '$n' Link to comment https://forums.phpfreaks.com/topic/71808-select-a-ranking-from-sum-count/#findComment-361959 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.