C
cjmccann
Hi
I'm having a problem updating a table using the UPDATE command and I'm going
crazy..!
I have a results table with the following fields (among others)
athlete,training_sessions, result, lowest_result
Many athletes have many training_sessions (M:M)
One Athlete can have n results for the same training_session.
I want to find the their lowest result and set the lowest_result field with
a tick (yes/no field).
Thus far I've tried the following;
UPDATE results
SET lowest_result=true
WHERE result = (SELECT MIN(result) FROM results);
It updates only one record.
How do I get it to take the athlete and training_session into account.
thanks in advance.
b rgds
CJM
I'm having a problem updating a table using the UPDATE command and I'm going
crazy..!
I have a results table with the following fields (among others)
athlete,training_sessions, result, lowest_result
Many athletes have many training_sessions (M:M)
One Athlete can have n results for the same training_session.
I want to find the their lowest result and set the lowest_result field with
a tick (yes/no field).
Thus far I've tried the following;
UPDATE results
SET lowest_result=true
WHERE result = (SELECT MIN(result) FROM results);
It updates only one record.
How do I get it to take the athlete and training_session into account.
thanks in advance.
b rgds
CJM