select * from infolist where usercode=$usercode and relation<>$relation
select count(distinct Relation) RecordCount from infolist where usercode='134' 这样就能计算出usercode=134,relation不同的记录个数!但是!! select distinct Relation from infolist where usercode='134'order by SendTime desc limit 0,10 一加上limit这句话就不管用!!选择的是所有usercode134的内容,包括relation相同的
我的表infolist里有code、relation、usercode……字段 我要选usercode相同而relation不同的记录个数来进行分页,我是用来分页的select count(*) from infolist group by usercode, relation
如果是记录中的usercode都相同,那不是要排序吗?
这样就能计算出usercode=134,relation不同的记录个数!但是!!
select distinct Relation from infolist where usercode='134'order by SendTime desc limit 0,10
一加上limit这句话就不管用!!选择的是所有usercode134的内容,包括relation相同的
我要选usercode相同而relation不同的记录个数来进行分页,我是用来分页的select count(*) from infolist group by usercode, relation