I have two tables in a database.
Both contain a related id but in a different format:
table1.field = 123456-12-34
table2.id = 123456
What Im trying to do is a join
on table1.id = table2.field
so the query looks like:
select name from
table1 left join table2 on table1.field like table2-%
where table2.flag='1' and DATEDIFF( now(), table1.timestamp ) > 2
I know this isn't correct, but how do i join two tables on fields where they are related but not the same?