Last active
April 28, 2016 21:43
-
-
Save leandrogilvalle/1740d1285d1a1413b142ef53772b675d to your computer and use it in GitHub Desktop.
PLSQL - Diferença entre duas datas - retorno no formato HH24:mi:ss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT trim(to_char(floor(((date1-date2)*24*60*60)/3600), '00')) || ':' || | |
| trim(to_char(floor((((date1-date2)*24*60*60) - floor(((date1-date2)*24*60*60)/3600)*3600)/60), '00')) || ':' || | |
| trim(to_char(round((((date1-date2)*24*60*60) - floor(((date1-date2)*24*60*60)/3600)*3600 - | |
| (floor((((date1-date2)*24*60*60) - floor(((date1-date2)*24*60*60)/3600)*3600)/60)*60) )), '00')) | |
| as time_difference | |
| FROM dates; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment