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;
其中variable变量保存内容是json字符串
【转自】https://blog.youkuaiyun.com/haiyoung/article/details/79939529