日期:2014-05-18  浏览次数:20518 次

怎么删除表中某个字段的值一样,但其他字段值不一样的记录
例如表 tbshow中


idno entdt
205073001 2009-07-07
205073001 2006-05-08
205073001 2003-08-14

想删除剩下最近一条记录 
5073001 2009-07-07
得怎么写语句 ?

------解决方案--------------------
SQL code
delete t from tbshow t where exists(select 1 from tbshow where idno=t.idno and dntdt>t.entdt)