I have a Sqlite database named test.db, which contains two tables with structures like this:
Table1: ID INTEGER PRIMARY KEY AUTOINCREMENT, Name varchar(500), Color varch
Use the replace() SQL function:
cur.execute("SELECT Color, Smell FROM Table1, Table2 "
"WHERE replace(Table1.Name, '\n', '') = Table2.Name")
You can update your whole Table Name column to remove the newline characters altogether:
cur.execute("UPDATE Table1 SET Name = replace(Name, '\n', '') "
"WHERE Name like '%\n%'")