select tfs."value" as v
from tn_field_string tfs
join tn_field tf on tf.id = tfs.id
where tf."owner" = rkkbase.id and tf.cmjfield = 'stage'
Число
tn_field_decimal
select tfd."value" as v
from tn_field_decimal tfd
join tn_field tf on tf.id = tfd.id
where tf."owner" = rkkbase.id and tf.cmjfield = 'index'
Дата
tn_field_dateonly
select tfs."value" as v
from tn_field_dateonly tfd
join tn_field tf on tf.id = tfd.id
where tf."owner" = rkkbase.id and tf.cmjfield = 'eventD'
Время
tn_field_timeonly
select tfs."value" as v
from tn_field_timeonly tft
join tn_field tf on tf.id = tft.id
where tf."owner" = rkkbase.id and tf.cmjfield = 'eventT'
Дата и время
tn_field_datetime
select tfs."value" as v
from tn_field_datetime tfdt
join tn_field tf on tf.id = tfdt.id
where tf."owner" = rkkbase.id and tf.cmjfield = 'eventDT'
Субъект СО
tn_field_string
coalesce(select string_agg(SPLIT_PART(tfs.value, '%', 1),',') as v
from tn_field_string tfs
join tn_field tf on tf.id = tfs.id
where tf."owner" = rkkbase.id and tf.cmjfield = 'Employee'),'Не указано')