我要选usercode相同而relation不同的记录个数来进行分页,我是用来分页的-----------$sql="select * from your_table where usercode='$usercode' and relation!='$relation'";这样应该是可以的

解决方案 »

  1.   

    楼主要是根据制定的usercode,relation来分页的话,楼上的就OK了
      

  2.   

    “usercode相同”是什么意思呢?跟什么相同啊?
    如果是记录中的usercode都相同,那不是要排序吗?
      

  3.   

    select * from infolist where usercode=$usercode and relation<>$relation
      

  4.   

    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相同的
      

  5.   

    我的表infolist里有code、relation、usercode……字段
    我要选usercode相同而relation不同的记录个数来进行分页,我是用来分页的select count(*) from infolist group by usercode, relation