通过查询语句
select autoid,cardid,min(stcardtime) from alldata
group by autoid,cardid,stcarddate
可以查到stcardtime为最小的所有集合!
但我要把该集合的列cardid项统一修改值,应该怎么办?! 急!如能解决 万分感激
select autoid,cardid,min(stcardtime) from alldata
group by autoid,cardid,stcarddate
可以查到stcardtime为最小的所有集合!
但我要把该集合的列cardid项统一修改值,应该怎么办?! 急!如能解决 万分感激
where stcardtime in
(select min(stcardtime) from alldata group by autoid,cardid,stcarddate)
是的话 update alldata set cardid=值
where autoid in(
select autoid from
(select autoid,cardid,stcarddate, min(stcardtime) from alldata group by autoid,cardid,stcarddatme) tmptable)
group by autoid,cardid,stcarddate )%为要修改的值