Login    Forum    Search    FAQ   Blog

Board index » Server Side Development » SQL




 Page 1 of 1 [ 5 posts ] 



Author Message
 Post subject: Logic 2 Copy the data from one table 2 another
 Post Posted: Thu Nov 19, 2009 6:53 am 
Offline

Joined: Sat Feb 21, 2009 1:03 pm
Posts: 47
hiiii alll
I woudl like to maintain da History of the records in one of da
table 4m anothr tab.
Here there could be multiple records 4 da same Date.howevr i need 2
insert da latest one records 2 the History table.

could u pls tell me how could we do this ?


Top 
 Post subject: Re: Logic 2 Copy the data from one table 2 another
 Post Posted: Thu Nov 19, 2009 6:54 am 
Offline

Joined: Sat Feb 21, 2009 11:06 am
Posts: 1794
Until u give more infos

Code:
insert into history_table(columns)
select columns from original_table
where date=(select max(date) from original_table)


Top 
 Post subject: Re: Logic 2 Copy the data from one table 2 another
 Post Posted: Thu Nov 19, 2009 6:54 am 
Offline

Joined: Sat Feb 21, 2009 1:03 pm
Posts: 47
Here comes the details.The main table holds da data fo the
5 days just after the it get purged.So i have to store these tab
details in the History table.It has da similar structure as da main
table.Also it must be stored procedure 2 run as the Schedule job aftr the
completion of gettin the values 2 the main table.
Pls help


Top 
 Post subject: Re: Logic 2 Copy the data from one table 2 another
 Post Posted: Thu Nov 19, 2009 6:54 am 
Offline

Joined: Sat Feb 21, 2009 1:03 pm
Posts: 47
Here comes the details.The main table holds da data fo the
5 days just after the it get purged.So i have to store these tab
details in the History table.It has da similar structure as da main
table.Also it must be stored procedure 2 run as the Schedule job aftr the
completion of gettin the values 2 the main table.
Pls help


Top 
 Post subject: Re: Logic 2 Copy the data from one table 2 another
 Post Posted: Thu Nov 19, 2009 6:54 am 
Offline

Joined: Sat Feb 21, 2009 11:06 am
Posts: 1794
Did u tried what I suggested?


Top 
Display posts from previous:  Sort by  
 
 Page 1 of 1 [ 5 posts ] 




Board index » Server Side Development » SQL


Who is online

Users browsing this forum: No registered users and 1 guest

 
 

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron