How do you hit the order by command?

0

I typed the following command in oracle;

select * from emp where ndep in(10,30);

and I had this as a result;

It'sallright,theproblemisthatIwantedtoputitinthedescendingorderofthedepartmentnumber;

Theseweremyattempts;

1stattempt;

select*fromempwherendepin(10,30)|orderbyndepdesc;

2ndattempt

select*fromempwherendepin(10,30)orderbyndepdesc;

3rdattempt

select*fromempwherendepin(10,30)andorderbyndepdesc;

Iwasnotsuccessful.

HowdoIgetthecommandright?

///////////////////////Updatingthepost

select*fromempwherendepin(10,30)andorderbyndepdesc;

thiswastheerrormessage;

ORA-00936:expressionnotfound00936.00000-"missing expression" * Cause:
* Action: Error on line: 3 Column: 5

    
asked by anonymous 24.12.2015 / 18:42

1 answer

1

Take out and

It looks like this:

select * from emp
where ndep in(10,30) 
order by ndep desc;

Fiddle with SQL running here .

    
24.12.2015 / 19:20