Posted By

konami99 on 10/28/11


Tagged

join Left


Versions (?)

left join trick


 / Published in: SQL
 

  1. LEFT JOIN (
  2. SELECT count(*) AS Counter, Year(members.DateCreated) AS MemberYear, Month(members.DateCreated) AS MemberMonth
  3. FROM ourdeal_backup.members
  4. GROUP BY MemberYear, MemberMonth
  5. ) AS TotalSubscribingMembers
  6. ON TotalSubscribingMembers.MemberYear = Year(transactions.DateCreated)
  7. AND TotalSubscribingMembers.MemberMonth = Month(transactions.DateCreated)

Report this snippet  

You need to login to post a comment.