Topic: Oracle Certified Professional Exams (OCP & OCA) >> 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.
|
|
|
|
| Title: Sql Query!!!!!!!!!! |
| Rush |
Posted: Apr 04, 2008 05:10:05 AM |
Total Post: 125
Joined: Jan, 2007
|
Hi all,
I want to know about % result of some table.means
i want to select 10%/20% of data from a table .
is there any way?
Thanks
Rupesh |
|
|
Ramesh Joyisa |
| Posted: Apr 04, 2008 06:17:37 AM | |
|
Total Post: 245
Joined: Aug, 2007
|
Hello Rupesh,
You can try
select * from table where rownum < ((select count(1) from table)*n)
In the above query replace table by table name and n by % u want i.e. if u want 10% then put 0.1 , if u want 20% use 0.2
u wil get the result..
|
|
|
|
|
Murtuja |
| Posted: Apr 04, 2008 06:28:53 AM | |
|
Total Post: 843
Joined: Jan, 2006
|
Use analytic function to gain performance in such query.
See CJ's answer in the below link .
http://forums.oracle.com/forums/thread.jspa?messageID=1430123
|
|
|
|
|
| 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 | 843 |
| Mohammed Taj | 746 |
| positive fanatic | 483 |
| Jayanta Sur | 479 |
| Vigyan Kaushik | 386 |
| Gitesh Trivedi | 322 |
| Gopu Gopi | 268 |
| neeraj sharma | 252 |
| Ramesh Jois | 245 |
| Bishal Khetan | 207 |
|
|