by
0
3
32
2
Easy-to-find
Refined
OpenSource
Created
Modified Jan 30, 2019

Published on:

AuthroEvaldo Maciel
IDESQL Develper
IDEToad
Languagesql
LicenseCreative Commons
LicenseMIT_X11
OSWindows
Windows VersionWindows 10

Função  para converter minutos para horas (SQL Oracle)

PLSQL  - SQL Oracle
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/4293807/Fun--o--para-converter-minutos-para-hora?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
-- Criando nova função create or replace function converter ( numero in number ) return varchar2 is minutos varchar2(10); begin return case length (case instr((numero / 60), '.') when 2 then '0' || substr((numero / 60), 1 ,1) when 3 then substr((numero / 60), 1 ,2) else to_char(numero / 60) end || '.' || lpad(mod(numero, 60), 2, 0)) when 4 then '0' || case instr((numero / 60), '.') when 2 then '0' || substr((numero / 60), 1 ,1) when 3 then substr((numero / 60), 1 ,2) else to_char(numero / 60) end || '.' || lpad(mod(numero, 60), 2, 0) else case instr((numero / 60), '.') when 2 then '0' || substr((numero / 60), 1 ,1) when 3 then substr((numero / 60), 1 ,2) else to_char(numero / 60) end || '.' || lpad(mod(numero, 60), 2, 0) -- temos os minutos end ; end converter; / select converter(valor), valor as valors from horario where valor is not null
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus