SELECT TOP 1 is returning multiple records

杀马特。学长 韩版系。学妹 提交于 2019-12-01 18:14:28

This happens because Access returns all records in case of ties in ORDER BY (all records returned have the same values of fields used in ORDER BY).

You can add another field to ORDER BY to make sure there's no ties. StudentID looks like a good candidate (though I don't know your schema, replace with something else if it suits better):

ORDER BY 
  Availability.NoOfFrees, Availability.StudentID;
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!