Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create view "Melhores_Piores_Clientes" as
- select a.codcliente, a.nome, sum(s.preço) montante
- from cliente a, servico s
- where s.codservico in (
- select ordem_viatura_matricula
- from "Ordem/Servico"
- where ordem_viatura_matricula in (
- select matricula
- from viatura
- where cliente_codcliente = a.codcliente))
- group by a.codcliente, a.nome;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement