<id_компонента> <id_продукта> <количество>
<id_рецепта> <id_компонента>
select *
from
(
SELECT
T0.ID ID,
T0.ClientID client_id,
T0.ClassID ClassID,
T0.SeniorID SeniorID,
T0.DNumber DNumber,
(SELECT NotEmptyStr(SO1.fullName, SO1.name) FullName$
FROM ActivityDirections SO1
WHERE SO1.ID = T0.ActivityDirection
) as AutoAlias_10750549,
(SELECT SO1.ID id_type
FROM ActivityDirections SO1
WHERE SO1.ID = T0.ActivityDirection
) as typeid
FROM T0
) x
where x.typeid IN (192922, 19333, 2323)