I'm working on a report, where I get the name of a person, and on what days it works. I was able to do this select, but I need the result to look like this:
[JOÃO - SEG/QUART] [MARIA - TERÇ/QUINT] [JOSÉ - SEG/TER/QUART]
I've used (xmlagg), but it's not working.
select DISTINCT
Substr(Obter_nome_medico(ag.CD_PESSOA_FISICA,'N'), 1, 100) nm_medico,
rtrim(xmlagg(xmlelement(e,substr(obter_valor_dominio(35,at.ie_dia_semana),1,1000),';').extract('//text()')),';')
from TABELA1 a, TABELA2 ag, TABELA3 at
where Substr(Obter_nome_medico(ag.CD_PESSOA_FISICA, 'N'), 1, 100) is not null
and a.cd_agenda = ag.CD_AGENDA
and ag.cd_agenda = at.cd_agenda
group by Substr(Obter_nome_medico(ag.CD_PESSOA_FISICA,'N'), 1, 100);