Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Partition by

Ganesh SrivatsavMay 5 2008 — edited May 5 2008
Hi,

After looking into some of the great features in oracle.. I am wondering if I can do this.
SQL> select sum(level) over(partition by level) from dual connect by level<=5;
 
SUM(LEVEL)OVER(PARTITIONBYLEVE
------------------------------
                             1
                             2
                             3
                             4
                             5
 
Above I get 5 rows because level is unique. so each row will be partitioned seperately.

Now I want to know If we can virtually partition the column

like give a fixed number say 2

the 1-2 will be first partition, 3-4 will be second and 5 will be 3rd.

Just like we do partition on a table based on sysdate... can we do that in a select query?

Regards,

G.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 2 2008
Added on May 5 2008
4 comments
488 views