I have a table in which each column represent a text from a manuscript, here is a simple example:
mss1 | mss2 | mss3
------------------------
The | The | A
big | big | big
black | |
dog | dog | dog
I would like to display rows where two columns have different values (or the same values), for instance I want to see the differences between mss1 and mss3. The result should look like:
mss1 | mss3
---------------
The | A
black |
These seemed to be good solution candidates :
SELECT mss1, mss3 FROM table WHERE mss1 != mss3;
SELECT mss1, mss3 FROM table WHERE mss1 NOT LIKE mss3;
However it is not working, even after converting all columns from text to varchar of the same length.
I also tried LOCATE (See here) to find same values: if I can locate mss1 in mss3 and vice-versa, they must have the same value, right? But that was not successful either. Any idea? It seems like it should be easy, but I can't figure it out...