Skip to content
Advertisement

Compare Two tables in SQL and equals row set to ‘True’ in new Column

Can some one explain the SQL query for bellow outcomes in TableResult.

There is two tables TableA and TableB, Function column in both tables are unique. Entire data in TableA should be there in ResultTable, If TableB Function equals in TableA function, Then ResultTable Compare column must be true otherwise it’s false.

Can anyone advised How to get the desired outcome in SQL.

Any help would be greatly appreciated

Advertisement

Answer

You can do it with EXISTS:

or:

See the demo.

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