You will find two tables:

TABLE bills

item_id | price
c1 | 10000
m1 | 9000
m2 | 8000

TABLE cars

id | model
1 | toyota
2 | bmw

I want JOIN both tables, where item_id=id And also the first letter in item_id is 'c', so I have to get: c1 10000 1 toyota

select * 
from cars c
join bills b on b.item_id = concat('c',

Observe that performance is orders of magnitude better (and acceptable) joining within this order, since the calculation to create the composite secret is done once per vehicle, instead of once per vehicle/bill combination had I became a member of bills first then cars.

Get it done such as this:

select b.*, c.*
from bills b 
inner join cars c on convert(substring(b.item_id, 2, 8000), int) =
where b.item_id like 'c%'