Please help with a simple query

Hi,

I would appreciate if someone could help me with this simple query I am struggling with:

I have a table holding the following:

  1. Running_ID - unsigned int (auto increment)
  2. User_ID - unsigned int
  3. Action - varchar(255)
  4. Time_Of_Action - datetime

Possible actions are: install and uninstall
Every time a user performs an action, a record is added to the table.
So a user could have: install, then uninstall, then install again, and so on

What I need is a query that will prepare a dump of User_ID and Time_Of_Action for users whose last action was ‘uninstall’
If a user only installed, or installed, uninstalled and then installed again, I don’t want him.

Any help would be appreciated
Thanks
Jason

SELECT t.User_ID 
     , t.Time_Of_Action 
  FROM ( SELECT User_ID 
              , MAX(Time_Of_Action) AS last_action
           FROM daTable
         GROUP
             BY User_ID ) AS m
INNER
  JOIN daTable AS t
    ON t.User_ID = m.User_ID
   AND t.Time_Of_Action = m.last_action
   AND t.Action = 'uninstall'

I see how you solved the problem