Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Sql Question 1
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
CREATE TABLE table1(Date DATE, Val INTEGER); CREATE TABLE table2(Date DATE, Val INTEGER); CREATE TABLE table3(Date DATE, Val INTEGER); INSERT INTO table1 values('2013-01-01', 4); INSERT INTO table1 values('2013-01-02', 3); INSERT INTO table1 values('2013-01-04', 2); INSERT INTO table2 values('2013-01-01', 5); INSERT INTO table2 values('2013-01-03', 4); INSERT INTO table2 values('2013-01-04', 1); INSERT INTO table3 values('2013-01-02', 3); INSERT INTO table3 values('2013-01-03', 1); INSERT INTO table3 values('2013-01-06', 8); with sample as ( select t1.date, t1.vAL from table1 t1 union all select t2.date, t2.vAL from table2 t2 union all select t3.date, t3.vAL from table3 t3 ) select date,sum(val) as Total from sample group by date
View schema
Execution time: 0,05 sec, rows selected: 5, rows affected: 9, absolute service time: 0,3 sec, absolute service time: 10,28 sec
edit mode
|
history
|
discussion