Topic: SQL*Plus and PL/SQL >> sql query
|
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.
|
|
|
|
| Neeraj |
Posted: Nov 21, 2007 05:31:55 AM |
Total Post: 258
Joined: Jan, 2007
|
hi,
i m want to retrive rows from a table but alternative rows ,
fetch first row then leave second then fetch third then leave four so on.
but only sql query not w/ pl/sql |
|
|
Babu |
| Posted: Nov 22, 2007 04:35:57 AM | |
|
Total Post: 94
Joined: Oct, 2007
|
SQL> SELECT * FROM TST;
Y NO
---------------------- ----------
MANGAI 1
MA_NGAI 2
MA_MA_GAI 3
MA_\DSFSD 4
SQL> select * from tst where (rowid,1) in ( select rowid,mod(rownum,2) from tst);
Y NO
---------------------- ----------
MANGAI 1
MA_MA_GAI 3
Babu B
|
|
|
|
|
| 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 |
| Vinoth Kumar | 357 |
| Gopu Gopi | 340 |
| Gitesh Trivedi | 322 |
| neeraj sharma | 258 |
| Ramesh Jois | 246 |
|
|