Dynamically search for same digits
I need help with the most efficient way to search for same digits in ids dynamically.
After I queried my table: select MyId from Mytable then I need to check if none of these ids consist of the same repeating digits such as 0000,1111,2222,......9999
To make it more complicated, MyId doesn't have a fix length, it can be 4 digits length or 5, 6 all the way to 9. So the search of the same digits it this ids also should also correspond to the length of the ids.
If MyId is 4 digit long, I should make sure none of the MyId contains 0000,1111,2222,33333,...all the way to 9999
Can anyone give me example on how to do this efficienly since I may deal with large records.
