select t.ID,
t.PROJECT,
t.TASK_NAME,
t.START_DATE,
t.END_DATE,
t.STATUS,
t.ASSIGNED_TO,
p.project as PROJ_NAME,
case t.STATUS
when 'Closed' then 'fa-check-circle-o'
when 'Open' then 'fa-exclamation-triangle-o'
when 'Pending' then 'fa-info-circle-o'
else 'fa-exclamation-circle-o'
end BADGE_ICON,
case t.STATUS
when 'Closed' then 'success'
when 'Open' then 'danger'
when 'Pending' then 'info'
else 'warning'
end BADGE_COLOR
from EBA_UT_CHART_TASKS t,
EBA_UT_CHART_PROJECTS p
where t.project = p.id
order by p.created