Database

turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

10-16-2017
03:32 PM

10-16-2017
03:32 PM

Hi,

I'd like to determine if an actual field value is a sequence of numbers (or letters if possible) or if all characters are the same. Working with Teradata Studio 15.0. I can convert the VARCHAR field to INTEGER to see if I can perform a mathematical operation to determine if it is a sequence or not but am not sure how to do this.

End Result:

COL_A IS_SEQ_TAG

123456 Y

987654 Y

197432 N

111111 Y

999999 Y

Thank you!

2 REPLIES

Highlighted
##
##### Re: Determine if a field value is a sequence

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

10-16-2017
06:55 PM

10-16-2017
06:55 PM

Are there any other kind of sequences than what you have listed? (fibonacci series, factors, all kinds of other thing).

If the answers is yes, I think it could be complicated (Type of number, int, smallint, bigint)?.

Can you please let me know your end goal?

I read somewhere "Finding numbers from a formula is a science. But finding a formula from numbers is an art."

I my view, SQL that address your question will be probably annoy your friend DBA (depending on size of the table).

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

10-16-2017
11:47 PM

10-16-2017
11:47 PM

Looks like some password checking routine :-)

This seems to be a perfect task for implementing a C-UDF.