Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
First Query
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); select Date,SUM(Val) from ( SELECT Date,Val FROM table1 Union SELECT Date, Val FROM table2 Union SELECT Date, Val FROM table3) as c group by c.Date
run
|
edit
|
history
|
help
0
SS mysqlsvr 2014 practice
gfhrey
dynamic pivot
Task_3_Final
Jean
Hack_this
Veterinary 1
Caronas
CTE reqursive query
Sum then delete one row - SQL Server 2008 R2