select x.variable::json->>'imageId' as imageId, x.status, y.image_name from task x join image y on x.variable::json->>'imageId' = y.image_id where x.variable::json->>'imageId' is not null and x.status is not null and y.is_valid is true;
Among them, the variable field in the task table is a json string, through
x.variable::json->>'imageId'
Get the image field in the json string and process it further.