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)+"%'";
+" and person.univ_id=school.college_id"
+" and school.location_id like'" + province_id.substring(0,2)+"%'";
我忘了能不能 distinct *了
+" and person.univ_id=school.college_id"
+" and school.location_id.substring(0,2)=province_id.substring(0,2)";
试试这样有几条。
有很多相同的记录肯定是联合的问题,distinct肯定可以解决问题,不过SQL的逻辑越严密越好。