Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
How to ROUND double precision type values?
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 rental; create table rental (customer_id int, rental_date date, return_date date); insert into rental values (1, '2019-01-01', '2019-01-02'), (1, '2019-01-01', '2019-01-03'), (2, '2019-01-01', '2019-01-05') ; SELECT customer_id , ROUND(AVG(return_date - rental_date), 2) AS rental_period FROM rental GROUP BY customer_id
absolute service time: 0,63 sec
edit mode
|
history
customer_id
rental_period
1
1
1,5000
2
2
4