We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Ok. The SUBSTR function I used in this excercise has 3 parameters:
String = corresponds to the name of a student.
The starting position = length(Name)-2. For example, If I've got a name like 'Carlos', this name's length is 6. I substract 2 to define the starting position, I mean 4. In this case, I will start extracting from the 'L' character.
How many characters am I going to extract?: In this case will be 3. And that's how I get the String to use it in the 'Order by' clause after the query.
I hope this explanation works :)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Higher Than 75 Marks
You are viewing a single comment's thread. Return to all comments →
Ok. The SUBSTR function I used in this excercise has 3 parameters:
String = corresponds to the name of a student.
The starting position = length(Name)-2. For example, If I've got a name like 'Carlos', this name's length is 6. I substract 2 to define the starting position, I mean 4. In this case, I will start extracting from the 'L' character.
How many characters am I going to extract?: In this case will be 3. And that's how I get the String to use it in the 'Order by' clause after the query.
I hope this explanation works :)