All pastes #406705 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-03-22 16:59 UTC
rendered paste body
Hi people, i trying to get the SUM of "total_logout - total_login"... the further i got it was it:
Some one can help me ?

Ae galera, to tentando fazer um SUM de "total_logout - total_login" ... o mais longe que chegeui foi isso ae:

SELECT id,

CAST(EXTRACT(HOUR   FROM hora_login) AS FLOAT)*3600 +
CAST(EXTRACT(MINUTE FROM hora_login) AS FLOAT)*60  +
CAST(EXTRACT(SECOND FROM hora_login) AS FLOAT) as total_login,

CAST(EXTRACT(HOUR   FROM hora_logout) AS FLOAT)*3600 +
CAST(EXTRACT(MINUTE FROM hora_logout) AS FLOAT)*60  +
CAST(EXTRACT(SECOND FROM hora_logout) AS FLOAT)  as total_logout

FROM tb_controle ORDER BY id