Oracle order by

1

Good afternoon guys trying to run the command below by sorting it down it displays the following error missing expression SELECT * FROM tab_style WHERE nm_uf like '% MG%' and like '% BA%' order by desc; Missing expression

    
asked by anonymous 09.04.2017 / 20:02

2 answers

0

The order by is used next to the name of the column used for sorting. Translating would be something like "order by colunax". Just put the name of the column after the command order by that the query will work.

    
09.04.2017 / 20:05
0
SELECT * 
FROM tab_estado 
WHERE (nm_uf like'%MG%' or nm_uf like'%BA%') 
order by nm_uf desc

Either the city is Minas or it is Bahia ... The order by asks for a column.

    
09.04.2017 / 20:47