﻿DROP FUNCTION IF EXISTS  dbo.fnGetOsztondijSzazalekFromAtlag
GO

CREATE FUNCTION dbo.fnGetOsztondijSzazalekFromAtlag (
   @pAtlag float
)
  RETURNS int
BEGIN  
  RETURN CASE 
    WHEN @pAtlag >= 2.0 AND @pAtlag < 3.0 THEN 8
    WHEN @pAtlag >= 3.0 AND @pAtlag < 4.0 THEN 25
    WHEN @pAtlag >= 4.0 AND @pAtlag <= 4.49 THEN 42          
    WHEN @pAtlag > 4.49 THEN 59
    ELSE 0
  END 
END
GO
