What will be the output of SELECT LENGTH(RTRIM("PEN ");?
What will be the output of SELECT LENGTH(RTRIM("PEN ");?
Solution
✅ Correct Option: 1
RTRIM() removes the trailing spaces from a string. So RTRIM("PEN ") gives "PEN", and LENGTH() counts its characters, which is 3.
Option 2: 5 is the length of "PEN " with its two trailing spaces, which is what LENGTH would return without RTRIM.
Option 3: 4 would result from removing only one of the two trailing spaces, but RTRIM removes all of them.
Related questions:
2025: 15 May Shift 2
2026: 26 May Shift 1
2025: 27 May Shift 2