I have one table as follows   

```
 id       | name  | action_date | user_id 
 1        | Jhon  | 2014-03-1   |  2
 2        | Smith | 2014-03-03  | 3
 2        | Jhon  | 2014-04-2   |  2
 3        | Jhon  | 2014-06-3  |  2 

```

I want to select all users who did action say from March to April and stop doing any action after that ?!
in this case will be `Smith` With user\_id `3`  

I have tried nasted SQL but with no luck !

Also i have tried using mysql\_row equivalent method like in SQL , please sea this 

```
SET @row_number = 0;
SELECT 
    @row_number:=CASE
        WHEN @customer_no = user_id THEN 
                    CASE when
                    DATE(action_date) >'2009-07-23' 
                    AND DATE(action_date) <'2009-07-25'
                    THEN
                     @row_number + 1
                    ELSE 211 END
        ELSE 1
    END AS Customer_Number,
    @customer_no:=user_id as Customers_id,
    action_date
FROM
    orders
ORDER BY Customers_id;

```

any ideas to do this using only Mysql .