this.sql="select distinct * from person,school,province where state=1"
               +" and person.univ_id=school.college_id"
               +" and school.location_id like'" + province_id.substring(0,2)+"%'";

解决方案 »

  1.   

    distinct school.location_id !
    我忘了能不能 distinct *了
      

  2.   

    如果要检索唯一结果,就要使用distinct关键字。
      

  3.   

    this.sql="select * from person,school,province where state=1"
                   +" and person.univ_id=school.college_id"
                   +" and school.location_id.substring(0,2)=province_id.substring(0,2)";
    试试这样有几条。
    有很多相同的记录肯定是联合的问题,distinct肯定可以解决问题,不过SQL的逻辑越严密越好。
      

  4.   

    SCHOOL是表啊 不是对象:( 这样肯定不行啊可是我用DISTINCT还没有调出来:(