select distinct itemcode,isnull(groupno,0)as groupnofrom Awhere 把Null的值以0显示,并Distint去重,不过,对于其他值也会去重,性能差一点,稳妥的做法是select distinct itemcode,isnull(groupno,0)as groupnofrom Awhere isnull(groupno,0)=0union allselect distinct itemcode,groupnofrom Awhere isnull(groupno,0)0...
|