A database I'm working with (but have not designed) has an odd structure in that the primary key (id) of one table's rows is contained within the primary key of another table's rows. For example, if table1 has a row with id '933', table2 will have a row with an id like that but prefixed with a word, e.g. 'something933'.
SELECT * FROM table1, table2 WHERE table1.id = table2.id
That's the base query, but because the content of table1.id is like '933' and table2.id is like 'something933', I need something like WHERE table1.id = table2.something+id.
Is there any way to join these tables in a single query?