问题如下图:
将BasMedName去重复,然后和ID一起显示但是ID必须是实际的值,不能用内连接,因为内链接会产生笛卡儿集
ID的值就会变,
去重复之后的结果集例如:
------解决方案--------------------
- SQL code
delete from a where not exists(select 1 from a where BasMedNam=a.BasMedNam and ID<a.ID)
------解决方案--------------------
delete from a where not exists(select 1 from a where BasMedNam=a.BasMedNam and ID<a.ID)
------解决方案--------------------