Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Sql Question 1
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
run
|
edit
|
history
|
help
0
Libros
Practice
Tbl
Check Constraints
NOT NULL field from SELECT INTO
Cross and outer apply
my sql2
h
Mahi
RH