我有一個資料表如圖 , 我先用group by Fcode , Ftype 篩選出重復多余的 ,
select Fcode form TB
group by Fcode , Ftype
having count(Fcode) >1
然后我想洗掉多余的行,比如說是圖片里面的第一行 , 請問如何寫delete 陳述句?
uj5u.com熱心網友回復:
delete a
from tb a
where
exists(select 1 from tb b where a.fcode=b.fcode and a.ftype=b.ftype and a.ctime < b.ctime)
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/71599.html
標籤:應用實例
上一篇:誰有北大青鳥ACCP8.0S1使用C#開發資料庫應用系統課后上機
下一篇:SQL 求下級合計問題
