PDA

View Full Version : Updating records


neptune
08-14-2005, 01:58 PM
I have a table that looks something like this:

myID myLat myLon Value1 Value2
23 28.5 -30.1 15 37
16 65
53 77
67 29.4 -30.6 34 65
45 67
22 26.5 -29.1 16 27
11 66
53 79

The number of records for each value in myID are not the same. What I need to do is go through the entire table and fill in the myID, myLat and myLon fields with values that are equal to those set previously, so that the result looks like this:

myID myLat myLon Value1 Value2
23 28.5 -30.1 15 37
23 28.5 -30.1 16 65
23 28.5 -30.1 53 77
67 29.4 -30.6 34 65
67 29.4 -30.6 45 67
22 26.5 -29.1 16 27
22 26.5 -29.1 11 66
22 26.5 -29.1 53 79

I'm very new to mysql. Can anyone tell me the best way to solve my problem?

Any assistance will be greatly appreciated.

raf
08-14-2005, 08:12 PM
Welcome here!

You wount be able to do yhis with MySQL. You'll need to do this with a serverside language (like PHP or ASP or so)
But even then, you'll need some columns to sort the recordset on, to be sure that the records are returned in that order.