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 |
lkiran086
Starting Member
21 Posts |
Posted - 2014-07-15 : 06:25:20
|
HiI have a table contains one column.It has numbers 1 to 100 but some numbers are missing.how can I find the missing numbers ? |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2014-07-15 : 06:50:44
|
Try this:select dt.number from(select number from master..spt_values where type = 'P' and number between 1 and 100)dtleft join YourTable t on t.YourColumn = dt.numberwhere t.YourColumn IS NULL Too old to Rock'n'Roll too young to die. |
|
|
lkiran086
Starting Member
21 Posts |
Posted - 2014-07-16 : 09:10:16
|
Thanks |
|
|
|
|
|