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
|
2225 Discussions
|
Please Login in order to post a comment
SQL SERVER
select name from students where marks > 75 order by RIGHT(NAME,3), id asc
PL/SQL, MySQL, SQL
--RIGHT() https://stackoverflow.com/questions/17409605/how-can-i-use-left-right-functions-in-sql-to-get-last-3-characters
MySQL:
SELECT NAME FROM STUDENTS WHERE 1=1 AND MARKS>75 ORDER SUBSTR(NAME,-3),ID ASC;
select name from students where marks >75 order by right(name,3) asc, id
MY SQL
SELECT NAME FROM STUDENTS WHERE MARKS > 75 ORDER BY RIGHT(NAME,3), ID ASC;