Now I have another problem 😉
Consider this.
SELECT COUNT(*) AS num, tblregion.sRegion AS region FROM leads_user_sends, tblregion JOIN tecknat_posts ON tecknat_posts.id = postId JOIN tblorter ON tblorter.cIdOrt = tecknat_posts.city OR tblorter.cIdOrt = tecknat_posts.city2 OR tblorter.cIdOrt = tecknat_posts.city3 WHERE sentDate >= '2005-04-26' AND sentDate <= '2005-05-26' AND tblregion.cIdRegion = tblorter.cIdRegion AND tblorter.cIdRegion IN(9,18,20) GROUP BY region
If I wish to select distinctly by a field in one of the tables i'm joining together, how do I do this?