Hi folks, I have a custom workflow that has a 'testing' state and am trying to generate an SQL query to show me the time a ticket most recently entered the testing state.
The query I have so far is: SELECT DISTINCT ticket_change.ticket as ticket, ticket.summary as summary, date(ticket_change.time, 'unixepoch')as inTest FROM ticket, ticket_change WHERE ticket.id = ticket_change.ticket AND ticket_change.field = 'status' AND ticket_change.newvalue = 'testing' The problem with this query is it will give duplicates if a ticket has gone into the 'testing' phase multiple times, for example if it went into to testing then was rejected, then entered testing again. How can I show only the most recent row? thanks for your help! Steve Povilaitis --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Trac Users" group. To post to this group, send email to trac-users@googlegroups.com To unsubscribe from this group, send email to trac-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/trac-users?hl=en -~----------~----~----~----~------~----~------~--~---