MySQL How to select value if ANY is present, or otherwise fallback to value if ALL match Say I have these two tables