RE: SQL problem |
||
![]() Ker sefo Maybe you could use the language you know to extract the data to a recordset or table and order it by ID ASC Then loop through your recordset and make an INSERT if record[i+1] != record[i] + 1 On 2008-08-18 09:53:18, MDalby wrote >I have a database with the columns `id` and `data` the `id` column contains different numbers with values between 1 and 999 . > >e.g. SELECT * FROM database would return > >----------- >|ID ||Data| >----------- >|2 ||dret| >|4 ||asdf| >|7 ||asdd| >----------- > >What i want to do fill in the gaps in `data` so that the column has all the numbers from 1 to 999 WITHOUT going over the ones that are (I need to keep the data intact) > >Desired Result.. >SELECT * FROM database > >----------- >|ID ||Data| >----------- >|2 ||dret| >|3 || | >|4 ||asdf| >|5 || | >|6 || | >|7 ||asdd| >|8 || | >|8 || | >|10 || | >----------- >etc... > >Does anyone have a simple way to do this, I've been up since the early hours and my brain has switched off :-( Replies:
|
||
| CyberArmy::Forum v0.6 Generated In 0.01778 seconds |