I'm trying to select the rows not present in table B
, based on table A
.
Unlike table B
, table A
has "_00" at the end of the titleid, and the column is called title
instead of titleid
.
Table A:
id | titleid
---+----------
1 | TEST1_00
2 | TEST2_00
3 | TEST3_00
4 | TEST4_00
Table B:
id | title
---+-------
1 | TEST1
2 | TEST2
I currently have:
SELECT `t1.titleid`
FROM `tableb t1`
LEFT JOIN `tablea t2` ON `t2.title + '_00' = t1.titleid`
WHERE `t2.title` IS NULL
How can I select the values which are present in A
but not in B
?
Desired output
id | title
---+----------
3 | TEST3_00
4 | TEST4_00