Q:

SQL - substring function - num of parametars?

The client gave me the task to see what is wrong with his big query, why it's not working. I spotted the error: It's in this part of the query:
and value <> substring(value2, 4)

When I put this, the query is working as the client wants:
and value <> substring(value2, 5)

However, I Googled what substring in SQL means and found this article:
https://www.sqlservertutorial.net/sql-server-string-functions/sql-server-substring-function/
But here we have two parameters inside substring and client uses only two. So, can someone explain the difference, or direct me to an article where I can find the answer?

A:

In databases that accept the two argument form of substring, the substring takes from the second argument to the end of the string.  The counts starts at 1, not 0, so substring(value, 1) in these databases would extract the whole string.
With three arguments, a positive third argument is always a length.  I don't recall off-hand if a negative third argument is allowed in any databases.
SQL Server requires three arguments.

