I have a database that looks like this:
ID parent ticket category _record_status _log_user _log_timestamp _log_type
------------------------------------------------------------------------------------------------
1 1 1 1 active 1 2012-01-29 15:49:21 create
2 1 1 1 deleted 1 2012-01-29 15:52:14 destroy
3 3 1 2 active 1 2012-01-29 15:58:43 create
I want to be able to select all records that are not deleted for a specified ticket. However, this is difficult because of the revision system.
Is there a way to do this via SQL that is efficient, or would it be better to just do this in PHP, considering each ticket will only have a few records on average. I doubt any ticket would ever get more than 100 records in it’s lifetime.
Is that what you’re looking for??