我想寫一個存儲過程,它會從90天以前的dirstaging.trr.table1和dirstaging.trr.table2中刪除記錄。相同的存儲過程將從dir.trr.ErrorTable中刪除dir.trr.table3和dir.trr.table4中沒有記錄的所有記錄。這個proc將接受變量@cleanup。我怎麼能寫storec proc哪些從table1和table2中刪除90天以前的舊記錄
注:我想是這樣,從表1和表2中選擇的所有記錄,並把他們在臨時表中,表1截斷和2對臨時表適用條件,以獲得最新的記錄,並在表1移動它們和2
我可以做不同的方式嗎?
感謝
對於什麼數據庫,表,以及什麼是「舊記錄」的資格? – 2010-10-22 02:00:26
請定義「舊記錄」 – akonsu 2010-10-22 02:00:29
您應該在詢問如此一般的問題之前嘗試閱讀文檔。 http://dev.mysql.com/doc/refman/5.1/en/stored-routines-syntax.html – Andrew 2010-10-22 02:00:45