Redmine
1
Вклад в тег
SELECT cv.id
cv.cnt,
cv.field_format
FROM
(
SELECT cv.id,
cv_m.cnt,
cf.field_format,
case when cf.multiple = 1 and cf.acl_trim_multiple = 1 then 1 else 0 end as mlt,
ROW_NUMBER() OVER (PARTITION BY i.id, cv.custom_field_id, ORDER BY i.id, cv.custom_field_id, cv.id) as row_number
SELECT cv.id
OVER (PARTITION BY i.id, cv.custom_field_id, ORDER BY i.id, cv.custom_field_id, cv.id)