Good day. Because oracle plsql developer from programming, but due to production needs, I got involved in this business, please help with writing a procedure in oracle plsql developer (I would be grateful for the help in creating the algorithm as well).
The essence is that - there is the first column (conditionally ID , in my context is not unique), and the second column, I will call it a "sign." The database is stored in this form.
ID Признак 1 Красный 1 Темно-красный 2 Синий 2 Бирюзовый It is necessary to write a procedure of this kind - all signs corresponding to the same ID are written in one cell. Those. So:
ID Признак (применение процедуры) 1 Красный, (или ;) Темно-красный 2 Синий, Бирюзовый I would be extremely grateful for the help! In a type of need I throw off a piece of select:
(case when (row_number() over(partition by (select dd.name from metrology.document dd where dd.id in (select **max(d.document_id)** from metrology.eqtype_document d where d.EQUIPMENT_TYPE_ID = e.id)) order by e.name)) = 1 then (select dd.name from metrology.document dd where dd.id in (select **max(d.document_id)** from metrology.eqtype_document d where d.EQUIPMENT_TYPE_ID = e.id)) end) as doc_name_to_form The characters ** mark a section of the code, because of which all fuss is produced. Max is included there purely for operability - this part of the select returns more than one line and causes an ora error, so I maxed it out by max, cutting it to one return result. But the fact is that in 70% of cases this section should return more than one value, which is why concatenation is necessary, and I do not know how to inject any code here.