CyberArmy University | Open Source Institute | CyberArmy Intelligence & Security | CyberArmy Services & Projects

SQL problem


[Replies] [Reply] [View by Thread] [Help]
[Back To Programming]

Posted by Gamma LtKer MDalby On 2008-08-18 09:53:18

Gamma LtKerGamma LtKer
Gamma LtKer MDalby


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:


Guest:
Subject:
Message:
Signature:
Optional Image Link:
http://

CyberArmy::Forum v0.6
Generated In 0.02364 seconds


About Us | Privacy Policy | Mission Statement | Help