Topic: SQL*Plus and PL/SQL >> Last Rows First and then Continue Fetching..!
|
Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property.
You may review the entire Oracle Certification Program Candidate Agreement online Here.
|
|
|
|
| Title: Last Rows First and then Continue Fetching..! |
| parth |
Posted: Mar 07, 2007 06:14:33 AM |
Total Post: 4
Joined: Mar, 2007
|
hi
,if suppose i have 14 rows in employee table.
give me 14 and 13,12,11,10 rows First and then continue from 1 to 9 so out put will be like
14 records
13
12
11
10
1
2
3
4
5
6
7
8
9
ok!
bye |
|
|
bunty |
| Posted: Mar 14, 2007 08:07:11 AM | |
|
Total Post: 6
Joined: Mar, 2007
|
with summ as
(select comp_appl_id,row_number()over(order by comp_appl_id) rn
from lot_loan_t
where rownum <= 14)
select * from summ
where rn in (14,13,12,11,10)
union all
select * from summ
where rn in (1,2,3,4,5,6)
|
|
|
|
|
man |
| Posted: Mar 15, 2007 06:25:36 AM | |
|
Total Post: 5
Joined: Sep, 2006
|
hi,
u can use this query,
select * from (
select * from emp1 order by a desc )
where rownum <= 4
union all
select * from (
select * from emp1 )
where rownum <= 10
|
|
|
|
|
parth |
| Posted: Mar 15, 2007 07:19:13 AM | |
|
Total Post: 4
Joined: Mar, 2007
|
hi thanx every one but perhaps this is not what i am looking for....i need randomly not "This kind of output " , this is just an exampale and i wanted to do it using CASE
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |
|
|
|
|
Forum Rules & Description
Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user
|
| |
Get FREE Magazines
|
Top 10 Forum User
|
| Murtuja Khokhar | 857 |
| Mohammed Taj | 746 |
| positive fanatic | 483 |
| Jayanta Sur | 479 |
| Vigyan Kaushik | 386 |
| Gopu Gopi | 333 |
| Gitesh Trivedi | 322 |
| Vinoth Kumar | 264 |
| neeraj sharma | 258 |
| Ramesh Jois | 246 |
|
|