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..