SQL QUERY:
SELECT
SUBSTR(to_char((39600/60/60),'00.00') , 0, INSTR(to_char((39600/60/60),'00.00'), '.', 1, 1)-1) hour,
to_char((SUBSTR(to_char((39600/60/60),'00.00'), INSTR(to_char((39600/60/60),'00.00'), '.', 1, 1),length(to_char((39600/60/60),'00.0'))) *60),'00') as Minutes
FROM dual;
OUTPUT
HOUR MINUTES
------ -------
11 00
1 rows selected
ANOTHER EXAMPLE
SELECT
SUBSTR(to_char((11700/60/60),'00.00') , 0, INSTR(to_char((11700/60/60),'00.00'), '.', 1, 1)-1) hour,
to_char((SUBSTR(to_char((11700/60/60),'00.00'), INSTR(to_char((11700/60/60),'00.00'), '.', 1, 1),length(to_char((11700/60/60),'00.00'))) *60),'00') as Minutes
FROM dual;
OUTPUT
HOUR MINUTES
------ -------
03 15
1 rows selected
No comments:
Post a Comment