select distinct(a.objid),a.*,u.username as objusername from usr_action_other a,usr_user u where a.type=1 and a.objid=u.userid and a.username='%s' order by a.crtime desc limit %d,%d
这个SQL语句,查询的结果不具有唯一性。请问是哪里有问题?
...全文
504打赏收藏
一个SQL语句,错在哪里?
select distinct(a.objid),a.*,u.username as objusername from usr_action_other a,usr_user u where a.type=1 and a.objid=u.userid and a.username='%s' order by a.crtime desc limit %d,%d 这个SQL语句,查询的结果不具有唯一性。请问是哪里有问题?
select distinct(a.objid),a.*,u.username as objusername from usr_action_other a,usr_user u where a.type=1 and a.username=u.username and a.objid=u.userid and a.username='%s' order by a.crtime desc limit %d,%d