Archives of the TeradataForum
Message Posted: Mon, 16 Jun 2003 @ 14:18:58 GMT
Subj: | | Consecutive sequence sql logic |
|
From: | | Burton, Bruce |
I'm trying to find phone numbers that exist on a given account that have at least 5 consecutive phone numbers in a sequence. From the
below example the 1st five phone numbers would meet the criteria and the distinct account would be selected for further processing. The 2nd
account would not be selected because the phone number is not in sequence or does not have at least 5 consec. sequenced numbers:
acct phone
121212 555-1212
121212 555-1213
121212 555-1214
121212 555-1215
121212 555-1216
921212 555-1111
921212 555-4444
Any ideas on how to convert this logic into SQL?
Thanks,
Bruce
|