Re: What is the use of Partition By function while inserting data into table.
Hi Jang, this is a totally stupid way to create a kind of random, but sequential value :-)
Stupid, because all the rows will probably be processed by a single AMP: ORDER BY 1 is *not* ordering by column 1, but by the value 1. PARTITION BY 1 is exactly the same as no partition at all.
If you really need a that random sequence then you might use: select ROW_NUMBER() OVER (ORDER BY rand), dt.* FROM (select RANDOM(-2000000000,2000000000) AS rand, CPNT_COMPLTN_DT from LCD_MYLEARNING_S ) as dt;
Otherwise choose partitioning and ordering columns as appropriate.