I have two tables
raw_commits(sha,date,author)
and
milestones(name,start,end)
where the milestones table contains the timestamp range for all the project’s milestones.
I am unsure on how to go about the JOIN to achieve the following:
For each raw_commits, show the raw_commits.sha, raw_commits.date, raw_commits.author, milestones.name if it has one milestone, show NULL if it doesn’t “belong” to a milestone, and show duplicate rows for each milestone, if the commit “belongs” to multiple milestones.
The categorization into milestones is obviously done by using the raw_commits.date as a reference, i.e. raw_commits.date >= milestones.start AND raw_commits.date <= milestones.end.
How to achieve the described behavior?
1 Answer