我正在使用 Flask-SQLAlchemy,我需要在查询中实现 case 语句,如下所示:
select j.id, j.record_count, j.ev_job_id, j.created_at, j.csv, t.name,
case
when j.status = 0 then 'Pending'
when j.status = 1 then 'Complete'
end status
from job_status j
inner join list_types t on (j.list_type_id = t.id)
order by j.id desc