Ok, so you are new to querying, and not as simple as many queries. Here is a SQLFiddle of your sample
First, because you have no indicator on which OK goes with which problem, it is IMPLIED that they are resolved on a first hit, first resolved for the respective host.
Now, the table column names. If you can, try to AVOID using table names AND column names that are otherwise reserved words, they can get in the way. (Trigger, Date for example).
Now, look at the issue you need to resolve. For each problem (outermost WHERE clause), you need to find the FIRST "OK" that corresponds to that problem / host. So here, I am using the same table 3 times, but using different "alias" name references so I know which one is which (via tProb, tOk, tChk ).
The left-join between the problem and the Ok is because not all problems may be resolved. This will allow the problem to be shown as OPEN if no corresponding Ok record found. The join condition itself is rather simple... Joining on the same host name.
However, the second part of the join for the ID is the tricky one. Here, it is a CORRELATED SUB-QUERY (which are typically performance killers). For each problem, you need to find the FIRST (via MIN) ID that is for that host, and is an OK status AND the ID is greater than the ID of the problem. You don't want an OK with ID = 2 be associated to PROBLEM with ID = 3. By using the MIN(), you will be guaranteed only a single entry if any.
Finally, the field selection of COALESCE() is to identify get the value from the ok table if one is so found. If NOT found, leave a blank value for display.. or '- still open -' for the Ok Status.
SELECT
tProb.id as ProblemID,
tProb.hostName,
tProb.trigger as Problem,
tProb.date as ProblemDate,
coalesce( tOk.id, 0 ) as OkID,
coalesce( tOk.`trigger`, '- still open -' ) as OkStatus,
coalesce( tOk.`Date`, ' ' ) as OkDate
from
Table1 tProb
LEFT JOIN Table1 tOk
ON tProb.hostName = tOk.hostName
AND tOk.ID in
( select
MIN( tChk.ID ) as ID
from
Table1 tChk
where
tChk.HostName = tProb.HostName
AND tChk.ID > tProb.ID
AND tChk.trigger = 'OK' )
where
tProb.trigger = 'PROBLEM'
order by
tProb.id
To help simplify this query, you might be best to add another column to the table for problemID. When a solution entry is entered, it should insert the ID of the problem as a basis there. Not necessarily a requirement to backstamp the original problem, just the solution to identify which problem it was resolving from the queue.