Skip to content
Advertisement

How can I override rows from another table?

I have two tables:

TableA

TableB

I want to select from both tables, but skip the rows which exist in TableB. The result should look like this:

I have tried union and join but did not figure out how to achieve this.

Advertisement

Answer

You could left join b on to a, and use coalesce to prefer b‘s rows:

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement