Oracle sql - Expression not found

Asked

Viewed 2,984 times

0

What I’m trying to do is this: List the names of the Cds that have a sales price greater than 10.00 reais or the label is code 3, ordered alphabetically by decreasing the names of the Cds. Show CD names starting with uppercase.

And I did the following query:

SELECT INITCAP(CD_NOME) FROM CD
INNER JOIN GRAVADORA ON CD.GRAV_CODIGO = GRAVADORA.GRAV_CODIGO AND CD_PRECO_VENDA > 10 OR GRAV_CODIGO = 3
ORDER BY DESC CD_NOME;

However, you are showing the following error:

ORA-00936: expression not found

What am I doing wrong? :(

  • 1

    The error (without entering the solution) is in order by, put ORDER BY 1

1 answer

0


Well, without checking the structure of the tables involved is difficult, but from what I read and understood, it should stay like this:

SELECT INITCAP(CD.NOME) FROM CD INNER JOIN GRAVADORA ON CD.GRAV_CODIGO = GRAVADORA.GRAV_CODIGO WHERE CD.PRECO_VENDA > 10 OR GRAVADORA.GRAV_CODIGO = 3 ORDER BY CD.NOME DESC ;

I hope I’ve helped.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.