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 Quote 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' Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.