Is there a way to compare the values ββof two columns in MySQL? For example, if I have a table:
+----------------+ | Col1 | Col2 | |----------------| | abc | 123abc | | def | 234def | | | 123ghi | +----------------+
And I wanted to get all the entries in Col2 containing the values ββof Col1 :
+---------+ | NewCol | |---------| | 123abc | | 234def | +---------+
How can i do this?
Here is a pseudo query to explain a bit.
SELECT Col2 FROM TableName WHERE Col2 LIKE Col1;
source share