I am joining the two tables using the query below:
update campaign_items
set last_modified = evt.event_time
from (
select max(event_time) event_time
,result
from events
where request = '/campaignitem/add'
group by result
) evt
where evt.result = campaign_items.id
where the result column is of character varying type and the id is of integer type But the data in the result column contains digits(i.e. 12345)
How would I run this query with converting the type of the result(character) into id (integer)
CAST(evt.result as int)