SELECT
  M.SCHEMA_NAME,
  M.REC_SQL,
  M.REC_WHERE,
  T.USER_PATTERN_NO,
  T.USER_PATTERN_NAME,
  T.DEFINE_NAME,
  T.HEADER,
  T.CONDITION_COLUMN,
  T.VERSION
FROM
  TR_GENERIC_CSV T
INNER JOIN
  MS_GENERIC_CSV M
ON
  M.DEFINE_NAME = T.DEFINE_NAME
  AND M.VERSION > 0
WHERE
  T.ID = /*:Id*/0
  AND T.INSERT_ID = /*:Uid*/'nakayama'
  AND T.VERSION > 0
