View previous topic :: View next topic
|
Author |
Message |
vinuthna2004
New User
Joined: 30 Dec 2005 Posts: 6
|
|
|
|
We need to UNLOAD todays data from table-1 and LOAD into table-2 (this holds 1 weeks worth data). i.e after UNLOADing into a file, we will LOAD that file to table-2?
While UNLOADing data from table-1 using BMC utility, do we need to use 'ORDER BY' clause on SELECT statement to sort the primary keys?
My doubt is. Tables are defined with primary key always. So when we are loading, it will insert the rows into table taking primary key constraits. So why to use ORDER BY clause? Or will it take longer time for rearranging the loaded rows if ORDER BY clause is not given? |
|
Back to top |
|
|
vasanthkumarhb
Active User
Joined: 06 Sep 2007 Posts: 275 Location: Bang,iflex
|
|
|
|
Hi Vinutha......
ORDER BY statement gives you in which order the table data will be displayed in ASCENDING order or DESCENDEING order u must knw that default is ASCENDING order respective of the primary key definition.
I think u will be knowing that ASC or DESC parameter is given with INDEX key definition which helps the query to manipulate quickly.
If the table_2 is created in such a way, in which it contains all the attributes of table_1 sucha as data type, primary key definition as same as table_1 index should be created on the primary key to boost up your query. INDEX key will reduce your time and tune your query accodingly.
Regard's
Vasanth........ |
|
Back to top |
|
|
vinuthna2004
New User
Joined: 30 Dec 2005 Posts: 6
|
|
|
|
Thanks for your advice. It was helpful |
|
Back to top |
|
|
|