MySQL Forums
Forum List  »  MySQL Workbench

MYSQL - QUERY
Posted by: Enrique Nogueira
Date: August 07, 2014 11:18AM

Good morning,
I have the following code



select distinct cli.nome,status.nome,cont.nome,count(site.designacao) as cnt_vsat from sih_site site
inner join sih_cliente cli on cli.id = site.cliente_id
inner join sih_contrato cont on cont.id = site.contrato_id
inner join sih_site_status status on status.id = site.site_status_id
inner join sih_produto prod on prod.id = site.produto_id
WHERE site_status_id IN (2) and prod.nome
not like 'Ponto Cliente WiMax'

and prod.nome not like 'HotSpot WiFi'

and prod.nome not like 'Ponto Cliente WiMax_2o Lote'

and cont.nome not like 'OI_BACKHAUL'

and cont.nome not like 'Oi_ESCOLAS'

and cont.nome not like 'OI ESCOLAS RURAIS'

group by cli.nome,status.nome,cont.nome

"Answer Consultoria";"ativo";"Bloco de Banda";91
"Answer Consultoria";"ativo";"HTBR-2011-ANS-002";360

Is there any way to join those who are equal? Ex: Answer Consultoria,
but without losing any information
Answer Consultoria - ativo - 91+360 = 451

Options: ReplyQuote


Subject
Views
Written By
Posted
MYSQL - QUERY
1400
August 07, 2014 11:18AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.