Modify timestamp query

Discussion in 'MySQL' started by videosurfer, Jun 30, 2010.

  1. #1
    I've got an unusual query.

    I'm looking to modify the timestamps on my MySQL records. I've got about 3000 records, and I'm wanting to make it so that the timestamps for the ascending records go from a beginning time / date to and end time / date on an average ascending time basis.

    In other words say the beginning time is 12:30 1 January 2001, and the end time is 12:30 1 January 2010, I'm wanting to create a query that will modify those 3000 records so that the first is the beginning time, and the last is the end time, and in between are progressively increasing time / dates that are averaged from the 3000 records (i.e. the middle row will be the half way mark between the two dates).

    Does anyone know how I can accomplish this with a PHP script or MySQL query?

    :cool:

    Thanks
     
    videosurfer, Jun 30, 2010 IP
  2. mastermunj

    mastermunj Well-Known Member

    Messages:
    687
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    110
    #2
    This can be pretty easily achieved by PHP. Doing it in pure MySQL will require writing an SP but that will be time consuming as well.
     
    mastermunj, Jul 13, 2010 IP