我遇到了这个查询的问题。我想对我的工资系统进行操作。我这是我的查询,它不起作用。
询问:
select
hrrawd_timein,
hrrawd_shiftin,
(
(extract(hour from (hrrawd_timein::time))
- extract(hour from (hrrawd_shiftin::time))
)::numeric
) AS shiftinhours,
(
(extract(minute from (hrrawd_timein::time))
- extract(minute from (hrrawd_shiftin::time))
)::numeric
) AS shiftinminutes,
(
((extract(hour from (hrrawd_timein::time))
- extract(hour from (hrrawd_shiftin::time)
))*60)::numeric
)
+
(
(extract(minute from (hrrawd_timein::time))
- extract(minute from (hrrawd_shiftin::time))
)::numeric
) AS Total,
case
when (Total >0) then 'Late'
else 'EARLY'
end as remarks
FROM hr.hrrawd;
错误:
> ERROR: column "total" does not exist LINE 7: case when (Total >0)
> then 'Late'