Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
samamun001
Starting Member
17 Posts |
Posted - 2005-01-09 : 09:23:28
|
| Hello,I have a table say temp. In temp the info is like1257I want the missing number.346How can I do it without using cursorsamamun |
|
|
amachanic
SQL Server MVP
169 Posts |
|
|
amachanic
SQL Server MVP
169 Posts |
Posted - 2005-01-09 : 09:34:52
|
| In retrospect, you may want to change it slightly:SELECT N.NumberFROM Numbers NLEFT JOIN YourTable TON T.Number = N.NumberWHERE T.Number IS NULL AND N.Number < (SELECT MAX(T1.Number) FROM YourTable T1) |
 |
|
|
nr
SQLTeam MVY
12543 Posts |
|
|
|
|
|