+ 1
Order
In python counting start form 0 Ex: if we have to tell the number of characters of "John" We say order 3 means 0,1,2,3 So, my actual question is this rule is not applied in SQL
2 Respuestas
+ 1
SQL is usually 1-based in string indexing, though that might not be universally true. Not all SQL engines follow the same rules. To be safe, check your SQL engine's documentation, or just test it with a quick query.
I often see confusion between counting and indexing. "John" has a count of 4 characters - in ALL languages, universally. Count always starts at 1.
Indexing is different from counting. Indexing answers the question of where to find each letter. It is a location, not a count. Some languages are 0-based, some 1-based, and some even let you arbitrarily define any number as a starting index value.
+ 2
python is a 3.5 generation language (OOP) but sql is 4th generation language (only for special things); you can't compare these