Skip to Main Content

Oracle Database Discussions

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!

Guidance on use of "COUNT(*) OVER () * 5" in a select query.

647939Dec 31 2008 — edited Dec 31 2008

Hello Friends,



I was reading one article, in which one table was created for demo. Following was the statements for there.



CREATE TABLE source_table
NOLOGGING
AS
SELECT ROWNUM AS object_id
, object_name
, object_type
FROM all_objects;



INSERT /*+ APPEND */ INTO source_table
SELECT ROWNUM (COUNT(*) OVER () * 5)+ AS object_id
, LOWER(object_name) AS object_name
, SUBSTR(object_type,1,1) AS object_type
FROM all_objects;



INSERT /*+ APPEND */ INTO source_table
SELECT ROWNUM (COUNT(*) OVER() * 10)+ AS object_id
, INITCAP(object_name) AS object_name
, SUBSTR(object_type,-1) AS object_type
FROM all_objects;



Can anyone please tell me the purpose of *"ROWNUM + (COUNT(*) OVER () * 5)"* in above 2 insert statements, or suggest me some document on that.
I don't know about its usage, and want to learn that..



Regards,
Dipali..

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 28 2009
Added on Dec 31 2008
2 comments
4,134 views