anyone know to how to create a query to find out if the data in one column contains (like function) of another column?
For example
ID||First_Name || Last_Name ------------------------ 1 ||Matt || Doe ------------------------ 2 ||Smith || John Doe ------------------------ 3 ||John || John Smith
find all rows where Last_name contains First_name. The answer is ID 3
thanks in advance
Select * from TABLE where instr(first_name, last_name) >= 1;
. And MySql has aninstr()
function that behaves the same way. – Marc