问题代码
select count(1) as count from smbms_user u,smbms_role r where u.userRole = r.id
order by creationDate DESC limit 0,5
问题根源
主要是两个表都有creationDate,sql不知道按照哪一个表去排序,所有会报这个指定不清的错
解决方法
在要排序的列名之前加上表名即可,如下
select count(1) as count from smbms_user u,smbms_role r where u.userRole = r.id
order by u.creationDate DESC limit 0,5