Lee wrote:
> Jerry: The problem with that is since this is an log, when someone
> places an entry afterwards saying order_id is 'GO', your query will
> always show that order_id as set. In my example table, 12345 would
> still show as 'SET' even though it's actually 'GO'
>
> I could do an update instead of an insert, but I want to track how long
> each step takes. I could also write another table with order_ids and
> just do update statements on it. It just bothers me I can't do it with
> just this table.
>
OK, I see your problem now.
That's going a little harder. If you have a version of MySQL which supports
subselects, you could have something like:
SELECT Order_Id FROM mytable
WHERE Status = 'SET' AND
Order_Id NOT IN (SELECT Order_Id
FROM mytable
WHERE Status = 'GO');
This will get all orders with the status of SET which do not also have the
status of GO. You could add checks for other status values, also.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================