the Prescription Date), where Mecidine nvarchar(100) and year int are respectively the first
☑ Kizspy. me and the second input parameters of the function.
Zoom
For example, when we call the F2 function in the following query, the results must be shown
as in the following figure:
7 of 7
Paper No: 9
select distinct Medicine, YEAR(Prescription Date) as Prescription Year,
dbo.F2(Medicine, YEAR(Prescription Date)) as NumberOfDoctors
from Prescriptions
where PrescriptionDate < '2022-01-01'
Prescription Year NumberOfDoctors
Medicine
1
Amoxicillin
2019
2
Amoxicillin
2020
4
11
+ 100%
Close