Skip to content
Advertisement

(challenging sql)compare two tables for different value

I want to compare values of table a & c and find differences. We can specify unique_key of table a by compare id between table a & b, and by matching unique_key of table b & c, we can compare Name of table a & c.

Can we get the list of rows that Name has different value for table a & c?

So If I write table,

As a result, I want to get

I tried this sql, but none of them get me correct result. What would you do?



real sql(for real DB) I made

error I got:

Advertisement

Answer

You can cast the field as BINARY before comparing

by default aa and AA, both are the same

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