Delete the N oldest entries grouped by multiple columns
If I understand you requirements clearly, you need to delete rows that are grouped on the basis of char and category (leaving minimum latest N rows)

Updated: Temporary table workaround

This can be achieved by

Option 1:

create temporary table test_table_rows_temp SELECT * from test;

DELETE t1
FROM 
    test  as t1
WHERE
    t1.id &lt; ( 
            SELECT 
                min( t2.id ) 
            FROM 
                test_table_rows_temp as t2 
            WHERE t2.category =  t1.category 
                    AND t2.`char` =  t1.`char` 
                    AND t2.id &gt;  t1.ID 
            HAVING count( t2.id ) &gt;= 2 
        ) 


I have created a temporary table to store the results of the test table, this helps to ease out the query

Option 2:

There's a workaround to avoid manually creating a temporary table by using a nested sub-query instead 

DELETE t1
FROM 
    test  as t1
WHERE
    t1.id &lt; ( 
            SELECT 
                min( id ) 
            FROM (
                SELECT 
                    id, 
                    category, 
                    `char`
                FROM test
            ) AS t2 
            WHERE t2.category =  t1.category 
                    AND t2.`char` =  t1.`char` 
                    AND t2.id &gt;  t1.ID 
            HAVING count( t2.id ) &gt;= 2 
        );


The nested sub-query internally too creates a temporary table :)

The 2 rows as mentioned above (ids 1, 4) are deleted

The query simply gets minimum - N + 1 id in the group of category, word (ordered by the latest id) and then checks if the current row id is less than the one retrieved (within the same group(s))

SQLFiddle

Hope this helps