trying to get the total number of boxes ordered from a given type("mytype"). something seems to be wrong with my syntax
create function NumOrdersForBoxType (mytype varchar(20))
returns int
begin
DECLARE @numorders int
select @numOrders = count(*)
from BOXES as B
where B.Type = mytype
return @numOrders
end
;