its not minus it is the range of the ID present in the table
ex. 1 to 2 are present in table
5 to 7 are present in table
9 is present in table
11 is present in table
so tht i can populate a combobox with different ids present in table else i need to get each item from table which wil be overload. If i have range i can manipulate in my application and get all the ids from the range i retrieved from table.
Unfortunately your explanation didn't make your "problem" more clear for me.
What are you going to populate in a combobox: IDs or Names?
What is wrong just to SELECT ID FROM [your table]?
I think that SELECT ID FROM [your table]
+ write 5-7 line of code to find all the cases where the next record ID is not equal (the previous one + 1) would be much faster than waiting for answers how to do it only by means of SQL.
No, I won't just try!
It will be a very simple exercise for you to write such a code. Then you should test how fast/slow will it work with your very big table. If too slow - then and only then you should try to improve it.
Bookmarks