Třídová akce

Popis:
Vrátí četnost použití podmínek pro uživatele progpoint a kind za poslední rok od zadaného měsíce a roku
Kód:
9
Tělo:
SELECT R.ConditionID, sum(R.NumberOfUse) as UseCnt FROM
 RestrictionUsages H,  RestrictionUsages2 R
WHERE
  (R.Parent_ID = H.ID) and
  (H.user_id = :User_ID) and 
  (((H.MonthOfUse <= :MonthOfUse) and (H.YearOfUse = :YearOfUse)) or ((H.MonthOfUse > :MonthOfUse) and (H.YearOfUse = :YearOfUse - 1))) and
  (H.programpoint = :ProgPoint) and (H.Kind = :Kind)
GROUP by R.conditionid
ORDER by UseCnt desc

Generated by ABRA Software a.s. 27.10.2021 16:34:11