Mysql setting a record as deleted or archive Is there any way to omit some records in mysql select statement and not deleting them? We can easily add a column for example deleted and set it to 1 for deleted ones and keep them but the problem is that we have to put where deleted = 1 in all queries. What is the best way to keep some records as an archive?
You basically have two choices.  You could use a view to do the filtering though this has some performance issues on MySQL, or you could use a trigger to copy deleted rows into an archive table.  I suspect that on MySQL, the trigger solution will be much better (on other DB's the tradeoffs may go other ways.