SELECT
  C.ITEM_NAME,
  C.CONDITION_KBN AS OPERATOR,
  C.CONDITION_ITEM AS CONDITION
FROM
  TR_GENERIC_CSV T
  INNER JOIN TR_GENERIC_CSV_CONDITION C ON
    T.USER_PATTERN_NO = C.USER_PATTERN_NO
    AND 0 < C.VERSION
  INNER JOIN MS_GENERIC_CSV M ON
    T.DEFINE_NAME = M.DEFINE_NAME
    AND 0 < M.VERSION
  INNER JOIN MS_GENERIC_CSV_DTL D ON
    M.DEFINE_NO = D.DEFINE_NO
    AND C.ITEM_NAME = D.PHYSICAL_ITEM_NAME
    AND 0 < D.VERSION
WHERE
  T.ID = /*:Id*/91
  AND T.VERSION > 0
ORDER BY
  C.DTL_NO
