3
I have to select the candidate who has more publications than any other candidate.
select candidato.nome, Count(1) as nr_publicacoes
from candidato, cv,ficha_inscricao, publicacao_cv
where candidato.bi = ficha_inscricao.bi and
candidato.bi = cv.bi and cv.cod_cv = publicacao_cv.cod_cv
group by candidato.nome;
But when I do max, Orale SQL Developer does not give results or error messages.
I don’t want to use the rownum
, my goal is to solve using the max
.
Solve, but the goal was to use understanding how to use the
max
instead of therownum
– Daniela Maia
I updated the question, see if that’s it, please.
– cantoni
In row 16 the identifier
nr_publicacoes
is invalid, there is no.– Daniela Maia
nr_publicacoes
was a variable I was trying to create using theas
– Daniela Maia
@Danielamaia, I don’t know what the structure of your database looks like. It’s certainly a mistake for my ignorance of your model. Field nr_publicacoes belongs to which table?
– cantoni
does not belong to any table, as you can see in my question, in the second row I am trying to create this new variable with the command
as
– Daniela Maia
Got it, this way you won’t solve this problem. You count the number of publications per candidate using the public table_cv?
– cantoni
Let’s go continue this discussion in chat.
– Daniela Maia