1 SELECT DEPTNO,DNAME FROM DEPT
2 ORDER BY DEPTNO DESC
DEPTNO DNAME
--------- --------------
40 OPERATIONS
30 SALES
20 RESEARCH
10 ACCOUNTING
i want the Second Highest Deptno on the Top and the others are as it is Which query is Apply there fore the result like this
DEPTNO DNAME
--------- --------------
30 SALES
40 OPERATIONS
20 RESEARCH
10 ACCOUNTING
then i want to show this in a parameter form is it possible
Najm
Report Parameter Query
-
- Posts: 25
- Joined: Fri Mar 31, 2006 4:49 pm
- Location: United Kingdom
Dear,
Here is the work way round to get the required results.
alter table dept add seq_no number;
update dept set seq_no=1 where deptno=30;
select Deptno,DName from dept order by seq_no,deptno desc;
DEPTNO DNAME
---------- --------------
30 SALES
40 OPERATIONS
20 RESEARCH
10 ACCOUNTING NEW YORK
Regards,
M.Omer Javed
ERP Technical Consultant
Mob:+923214647529/ +923004479693
Here is the work way round to get the required results.
alter table dept add seq_no number;
update dept set seq_no=1 where deptno=30;
select Deptno,DName from dept order by seq_no,deptno desc;
DEPTNO DNAME
---------- --------------
30 SALES
40 OPERATIONS
20 RESEARCH
10 ACCOUNTING NEW YORK
Regards,
M.Omer Javed
ERP Technical Consultant
Mob:+923214647529/ +923004479693
-
- Posts: 25
- Joined: Fri Mar 31, 2006 4:49 pm
- Location: United Kingdom
Who is online
Users browsing this forum: No registered users and 10 guests