我做的公交查询系统,但是查询出来的数据有重复我现在想每个换乘路线1只留一条,比如67路只留一个,68路只留一个,也就是将查询的多字段其中的一个字段去重,请教应该怎么去,下面是我的查询代码:
select a.start_stop as 启始站点,a.line as 乘坐路线1,a.end_stop as 中转站点,b.line as 乘坐路线2,b.end_stop as 目地站点,abs(a.count)+abs(b.count) as 经过站点数 from farsail.bus a, farsail.bus b where a.start_stop='黑龙江大学' and b.end_stop='哈站' and a.end_stop=b.start_stop and a.line!=b.line order by a.line