ORACLE SQL it is possible to customize the order result of a query? -



ORACLE SQL it is possible to customize the order result of a query? -

i have case in need order query result in customized order next :

the departement_id needs in order ( 10 50 20 )

is there way result ?

you utilize case look in order by clause.

i answered similar question here, http://stackoverflow.com/a/26033176/3989608, tweak have customized conditions in case expression.

for example,

sql> select ename, 2 deptno 3 emp 4 order 5 case deptno 6 when 20 1 7 when 10 2 8 when 30 3 9 end 10 / ename deptno ---------- ---------- smith 20 ford 20 adams 20 jones 20 scott 20 clark 10 king 10 miller 10 allen 30 turner 30 ward 30 martin 30 james 30 blake 30 14 rows selected. sql>

sql oracle-sqldeveloper

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -