Click here to Skip to main content
15,917,328 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
dears i am using sql database the columns are as follows :oldDate | stockDate | open | close

how can i update all the rows and set them to the first "close" and last "open" order by oldDate within the same stockdate example:
for stockdate "2014-01-01" the first open is:17.00 and the last close is: 16.910
then i need to update all records that have stockdate:"2014-01-01" and set the close 16.910 and open = 17.0 and so on for every stockDate ...

2014-01-29 17:00:00.680 2014-01-01 00:00:00.000 2014 17.000 17.000
2014-01-30 17:00:00.460 2014-01-01 00:00:00.000 2014 16.800 16.910
2014-02-02 17:00:00.220 2014-02-01 00:00:00.000 2014 16.850 17.000
2014-02-27 17:00:00.247 2014-02-01 00:00:00.000 2014 16.780 16.450
2014-03-04 17:00:00.260 2014-03-01 00:00:00.000 2014 16.700 16.220
2014-03-05 17:00:00.350 2014-03-01 00:00:00.000 2014 15.500 16.200
Posted
Comments
Tomas Takac 23-Jan-15 9:09am    
Which database? Plus what have you tried so far?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900