In the table below, we have the employees' salaries in the column (SAL) and the accumulated salaries in the other, my question is how can I get the column of salaries (SAL) from the column of cumulative salaries.
and what i want is : The total number of confirmed cases per province or, when not
available, by country .
Can you help me ?
i tried this , but isnt right because in this case i cant do the SUM
Select SUM (Confirmed),Province_State,Country_Region
from world_health_i1160437.covid_19
Group by Province_State,Country_Region
I will be happy to help you. Once you get us the data in the format you were requested to give it in?
Not going to retype all of that data in the image for you and also give you an answer. Help us help you. We cant see or access your database so you will have to provide not an image but DDL and DML
declare @paleale table(SNO int, ObservationDate date, Province varchar(150),
Country nvarchar(50), LastUpdate Datetime,
Confirmed decimal(10,3), Deaths decimal(10,3)
)
insert into @paleale
select 1, '2020-01-22', 'Anhui', 'Mainland China', '2020-01-22 17:00', 1.0, 0.0 union all
---next row
--next row
--your whole csv, type it out as above
the below should work
Select
SUM (Confirmed)
, Province_State
, Country_Region
from
world_health_i1160437.covid_19
Group by
Province_State
, Country_Region
what does this mean ?
The total number of confirmed cases per province or, when not
available, by country .
hi
i think the sum doest work because the number of confirmed cases is cumulative
for example, in the day 1 there are 20 cases and in the day 2 there are 30. it means that there are (20+10) cases in total