0
Guys, could help me I’m trying to create a view "POSICAO_EQUIPES", with a Query that displays the overall classification by Teams, regardless of category. The query should display the Championship ID, Team ID, Team Name and the sum of the amount of points of your drivers, ordered by Idcampeonato and Points in descending order. (use JOIN, SUM and Group BY command)
My Code is like this:
create view POSICAO_EQUIPES as
SELECT
T1.IDCampeonato as 'ID do Campeonato',
T2.IDEquipe as 'Id da Equipe',
T2.NomeEquipe as 'Nome da Equipe',
C.IDClassificacao, SUM (C.pontos) as 'Total de pontos por Equipe', sum (C.pontos + C.CATEGORIA)
FROM
Classificacao C,
pilotoequipe T1
join equipes T2 on (T2.IDEquipe = T1.IDEquipe)
join pilotos T3 on (T3.IDPiloto = T1.IDPiloto);
And what error, in the title of the question, you claim to exist. If you are getting any results, what is the result obtained and what is expected?
– anonimo
The error is in my code, but I don’t know where...
– Joaquin
You probably do not want a string but quoting. Change
'
by ` (grave accent) in its alias_name.– anonimo
Already fix, but not solved
– Joaquin
Sorry, my crystal ball is offline.
– anonimo