Mysql
 sql >> Datenbank >  >> RDS >> Mysql

So wählen Sie DISTINCT-Zeilen aus, ohne dass das Feld ORDER BY ausgewählt ist

SELECT s.pID
FROM students s JOIN mentors m ON s.pID = m.pID   
WHERE m.tags LIKE '%a%'
GROUP BY s.pID
ORDER BY MAX(s.sID) DESC