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.
- Prepare
- SQL
- Basic Select
- Higher Than 75 Marks
- Discussions
Higher Than 75 Marks
Higher Than 75 Marks
Sort by
recency
|
2271 Discussions
|
Please Login in order to post a comment
SELECT NAME FROM STUDENTS WHERE MARKS > 75 ORDER BY RIGHT(NAME, 3), ID ASC;
in sql server
--oracle SELECT Name FROM STUDENTS WHERE Marks > 75 ORDER BY SUBSTR(Name, -3), ID;
Here is my solution (I know that there are some unnecessary columns in the CTE, however, it was the easiest way to check the output step by step in my case); with
SELECT NAME FROM STUDENTS WHERE MARKS > 75 ORDER BY SUBSTR(NAME,-3),ID;