My program uses SQLite.
I have 4 columns in a DBGrid.
I want to compare Columns 2 and 4 and compare the strings in each, and where they don't match, I want to show the rows with the cells of all 4 columns.
I am using this, but it is showing me two columns, and more critically it is showing me all the values instead of just the few that do not match
TSQLQuery(DBGrid.DataSource.Dataset).SQL.Text := 'SELECT ColumnText2, ColumnText4 FROM TBL_MAINTABLE WHERE ColumnText2 <> ColumnText4';
I'm fairly new to SQL overall so would value a pointer? Thanks