Archives of the TeradataForum
Message Posted: Mon, 16 Jun 2003 @ 14:54:58 GMT
This will probably require a stored procedure to solve correctly.
But till then, if you just want to probe your data, you could do something like below (assuming phone is stored as integer or can be casted as such):
sel acct, count(acct) cnt, max(phone) - min(phone) as Dif
This will tell you who has exactly 5 consecutive numbers. You could then loop through manually and increase the 5 and 4 by 1 to see who has 6, 7, 8, etc. consecutive phone numbers. If you don't have to many then, perhaps a distinct union of these statements could generate a final list. Otherwise, a more elaborate stored procedure will be necessary. Just my 2 cents.
|Copyright 2016 - All Rights Reserved|
|Last Modified: 27 Dec 2016|