Thanks for your helpful response.
Michael Glaesemann wrote:
> I don't seem to have a problem with the ordering given your data. I'm
> not sure why you're doing right and left joins, though. You might want
> to use left joins if you have NULL id1 or id2, but otherwise just plain
> JOIN should work fine. I've included both your SELECT (slightly modified
> to avoid using key words) and how I'd probably right the statement.
id1 will always have a value but id2 can be NULL. So should I do a left JOIN
on id2 but a plain JOIN on id1? Is there a disadvantage to using a left JOIN
where it is not necessary?
Adam