Robert Sanderson schrieb:
> Suggestions for a slight revision to the substring proposal to reduce
> the number of special cases:
>
> * The positions should be 1 based (as much as I'm a zero based person)
> - It's more consistent with result sets being 1 based.
> - It allows for:
>
> * Both start and end position should allow for negative, 0, or positive
> integers. Negative or 0 means count back from the end that many
> characters.
If revised, the syntax should be similar to other query languages:
SQL: SUBSTR(string, start, len])
'start' starts with 1 and 'len' can be omitted
XPath: substring(string,start,len)
'start' starts with 1 and 'len' can be omitted
XQuery uses XPath
SPARQL uses XPath
See also http://www.w3.org/TR/xquery-operators/
So 1-based should not be used because of additional non-standard fancy
stuff that nobody will use, but because of it's standard in modern query
languages.
Greetings,
Jakob
|