Sub DeleteDuplicateSQL
Dim strSQL As String
Dim lAffectedRows As Long
Msgbox2Async("Are you sure to delete duplicate SQL from the table SQL?", _
"Delete duplicate SQL from table SQL", "Yes", "No", "", General.bmpIcon32, False)
Wait For Msgbox_Result(result As Int)
If result = -1 Then
strSQL = "DELETE FROM SQL WHERE ROWID NOT IN(" & _
"SELECT MAX(ROWID) FROM SQL " & _
"GROUP BY SQL)"
General.SQL1.ExecNonQuery(strSQL)
lAffectedRows = GetNumberOfChanges
cEvents.ShowMsg("Duplicate rows deleted: " & lAffectedRows, _
"Delete duplicate SQL from table SQL", 0, 0, Null, General.bmpIcon32, True, True)
End If
Msgbox2Async("Are you sure to delete duplicate SQL from the table RUN_SQL?", _
"Delete duplicate SQL from table RUN_SQL", "Yes", "No", "", General.bmpIcon32, False)
Wait For Msgbox_Result(result As Int)
If result = -1 Then
strSQL = "DELETE FROM RUN_SQL WHERE ROWID NOT IN(" & _
"SELECT MAX(ROWID) FROM RUN_SQL " & _
"GROUP BY SQL)"
General.SQL1.ExecNonQuery(strSQL)
lAffectedRows = GetNumberOfChanges
cEvents.ShowMsg("Duplicate rows deleted: " & lAffectedRows, _
"Delete duplicate SQL from table RUN_SQL", 0, 0, Null, General.bmpIcon32, True, True)
End If
End Sub