Subject | Substring |
---|---|
Author | Ann W. Harrison |
Post date | 2004-10-14T21:17:27Z |
Does anyone know the rules for the starting position
of an 'ordinary' substring function in standard SQL?
I have found that the first character is 1 and that
the starting position must be a numeric, scale 0.
Some implementations allow 0 and negative starting
positions. For example:
substring ('abcdefghij' from 1 for 5) => 'abcde'
substring ('abcdefghij' from 0 for 5) => 'abcd'
substring ('abcdefghij' from -1 for 5) => 'abc'
Is this right? wrong? implementation defined?
Thanks,
Ann
of an 'ordinary' substring function in standard SQL?
I have found that the first character is 1 and that
the starting position must be a numeric, scale 0.
Some implementations allow 0 and negative starting
positions. For example:
substring ('abcdefghij' from 1 for 5) => 'abcde'
substring ('abcdefghij' from 0 for 5) => 'abcd'
substring ('abcdefghij' from -1 for 5) => 'abc'
Is this right? wrong? implementation defined?
Thanks,
Ann