How to select DISTINCT rows without having the ORDER BY field selected

前端 未结 6 1208
我寻月下人不归
我寻月下人不归 2021-01-06 15:49

So I have two tables students (PK sID) and mentors (PK pID). This query

SELECT s.pID
FROM students s JOIN mentors m ON s.pID = m.pID
WHERE m.tags LIKE \'%a%\         


        
6条回答
  •  旧时难觅i
    2021-01-06 16:40

    You can't receive records in any predefined order if you don't use ORDER BY because then the DB engine decides in what order to return them.

提交回复
热议问题