I have a situation here I have two selects results that are ok but I would like to change the result to one of the selects.
select sum (r.l.numero_exames_relacionados), estabelecimento_saude.nome_fantasia
from r.l.
left join r.e. on r.l.identificador_estudo_dicom = r.e.identificador
left join pessoa on r.l.identificador_profissional_saude = pessoa.identificador
left join estabelecimento_saude on r.e.identificador_estabelecimento_saude = estabelecimento_saude.identificador
where (data_hora_inclusao BETWEEN '2017-08-01 00:00:00' AND '2017-08-31 23:59:59')
and (estudo_dicom.modalitiesinstudy ='CT'
and (estabelecimento_saude.nome_fantasia <> 'ESTABELECIMENTO')
and (texto not like '%EXEMPLO%')
group by estabelecimento_saude.nome_fantasia, r.l.modalitiesinstudy as 'CTA'
I would like only for the output of the select I could change the modalitiesinstudy to whatever value I chose. And need to do an update on the bank.