Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
ze
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
drop table a8; create table a8(id integer,start datetime,ende datetime); insert into a8(id, start, ende) values (1, '2018-9-15T10:00','2018-9-15T20:44'); insert into a8(id, start, ende) values (1, '2018-9-25T10:00','2018-9-25T20:44'); insert into a8(id, start, ende) values (1, '2018-5-16T10:00','2018-5-16T20:44'); insert into a8(id, start, ende) values (1, '2018-6-16T10:00','2018-6-16T11:01'); insert into a8(id, start, ende) values (1, '2018-6-17T10:00','2018-6-17T11:01'); insert into a8(id, start, ende) values (1, '2018-7-10T16:00','2018-7-10T17:59'); insert into a8(id, start, ende) values (1, '2018-7-17T16:00','2018-7-17T17:59'); insert into a8(id, start, ende) values (1, '2018-7-18T12:30','2018-7-18T17:59'); insert into a8(id, start, ende) values (1, '2018-8-17T16:00','2018-8-17T17:59'); insert into a8(id, start, ende) values (1, '2017-7-10T16:00','2017-7-10T17:59'); insert into a8(id, start, ende) values (1, '2017-7-17T16:00','2017-7-17T17:59'); insert into a8(id, start, ende) values (1, '2017-7-18T12:30','2017-7-18T17:59'); insert into a8(id, start, ende) values (1, '2017-8-17T16:00','2017-8-17T17:59'); insert into a8(id, start, ende) values (1, '2017-1-17T16:00','2017-1-17T17:59'); select sum(time_to_sec(timediff(ende,start))) Sekunden, year(start) Jahr, month(start) Monat, truncate(sum(time_to_sec(timediff(ende,start)))/3600,0) Stunden, truncate( (sum(time_to_sec(timediff(ende,start))) - truncate(sum(time_to_sec(timediff(ende,start)))/3600,0) * 3600) /60,0) Minuten from a8 group by year(start),month(start) order by year(start) desc,month(start) desc
absolute service time: 0,41 sec
fork mode
|
history
|
discussion