Generate Grouping join table