You could try this in a SQL statement using a union to make 1a and 1b 1 table before performing the join