Given a SQL Server Database has a table named say mydata, with fields start_time (Date/Time) and duration (number) fields ... The table is actually a telco call data record (fields trimmed). There is no primary key
The requirement is to calculate : -
The sum of duration for a record for all the days of a given month, e.g.
Day 1 .... nnn duration calls
Day 2 .... nnn duration calls
...
Day x .... nnn duration calls
Please help me design a SQL query (based on transact-sql for SQL Server)
Question
g3nu1n3
Given a SQL Server Database has a table named say mydata, with fields start_time (Date/Time) and duration (number) fields ... The table is actually a telco call data record (fields trimmed). There is no primary key
The requirement is to calculate : -
The sum of duration for a record for all the days of a given month, e.g.
Day 1 .... nnn duration calls
Day 2 .... nnn duration calls
...
Day x .... nnn duration calls
Please help me design a SQL query (based on transact-sql for SQL Server)
Help much appreciated.
Sample data shown in figure attached.
Link to comment
Share on other sites
4 answers to this question
Recommended Posts