Conditional JOIN Statement SQL Server
I think what you are asking for will work by joining the Initial table to both Option_A and Option_B using LEFT JOIN, which will produce something like this: Initial LEFT JOIN Option_A LEFT JOIN NULL OR Initial LEFT JOIN NULL LEFT JOIN Option_B Example code: SELECT i.*, COALESCE(a.id, b.id) as Option_Id, COALESCE(a.name, b.name) as Option_Name … Read more