Sim 284 Posted January 24 Share Posted January 24 SELECT COUNT(JR_refID) AS rankCount, J_id AS id, J_name AS name, J_desc AS `desc` FROM jobs JOIN jobRanks ON(J_id =JR_refID) GROUP BY J_id ORDER BY J_id ASC My problem is if theres a job with no Ranks, it is not included in in the results. What am I missing? Thanks in advance!! I know @Magictallguy got an answer here. Quote Link to post Share on other sites
AdamHull 85 Posted January 24 Share Posted January 24 (edited) You need to use LEFT JOIN then this should solve your issue SELECT COUNT(JR_refID) AS rankCount, J_id AS id, J_name AS name, J_desc AS `desc` FROM jobs LEFT JOIN jobRanks ON( J_id =JR_refID ) GROUP BY J_id ORDER BY J_id ASC Edited January 24 by AdamHull 1 Quote Link to post Share on other sites
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.