Run Code
|
API
|
Code Wall
|
Users
|
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
Please
log in
to post a comment.
VANYA
Find effective count of employees within date range for each calendar week
forming date as nvarchar
sql server dynamic 12 month time series and pivot with month year column names
Exam_2_Final
Arif
Loan37
How to add namespace to sql generated XML output
Creation tables
Test1
Please log in to post a comment.