Web lists-archives.com

Re: Capturing milestone data in a table




>>>> 2015/03/04 09:21 -0500, Phil >>>>
One option would be to create a trigger for each milestone to generate the
data instead. That could be a lot of triggers, not sure if it could be
done in a single trigger, plus then I would have to maintain the trigger
when adding new milestones.
<<<<<<<<
Less trouble if there is also a table of milestones: upon each change
(UPDATE?) find out whether in the milestone table there is such a
milestone that OLD.metric < milestone AND milestone <= NEW.metric. If
there are more, I suppose you want the MAX(milestone):
	SET newPassd = (SELECT MAX(milestone) FROM milestone WHERE milestone >
OLD.metric AND milestone <= NEW.metric);
If not NULL, that is the milestone to record.

My point is only that you can do it, not that it is the best for you.
Maybe the traffic is too heavy for it.


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql