﻿DROP PROCEDURE IF EXISTS uspKIRstat_Evfolyam
GO

CREATE PROCEDURE uspKIRstat_Evfolyam
   @pFeladatellatasiHelyId int
  ,@pTanevId int
AS
BEGIN
  SET NOCOUNT ON;

SELECT DISTINCT 
  d.C_NAME_4 
FROM T_OSZTALYCSOPORT_OSSZES ocs 
  INNER JOIN T_OSZTALY_OSSZES o ON o.ID = ocs.ID 
    AND o.TOROLT = 'F'
  INNER JOIN T_DICTIONARYITEMBASE_OSSZES d ON d.ID = ocs.C_EVFOLYAMTIPUSA 
    AND d.C_TANEVID = ocs.C_TANEVID
WHERE ocs.C_TANEVID = @pTanevId 
  AND ocs.TOROLT = 'F' 
  AND ocs.C_FELADATELLATASIHELYID = @pFeladatellatasiHelyId

END
GO