I have the case of a time worked and his salary for hours. I need to calculate how much they have charged:
SELECT '07:45'::time as horas_trabajadas,
8.45::numeric(18,2) as precio_hora,
'07:45'::interval * 8.45 as total_dia
Here the subject is in which% total_dia
comes out as:
0 years 0 mons 0 days 65 hours 29 mins 15.00 secs
And I need you to tell me what the worker has earned. In this case, it would be: 7.75*8.44 = 65.4875
I think it has to be simple, but I do not see the solution
Here is a Fiddle with the query