nevermind
SELECT
ost.id,
ost.orderId,
ost.newStatus
FROM order_status_tracking AS ost
INNER JOIN order_status_tracking AS ost2 ON ost.orderId = ost2.orderId
WHERE ost.date >= '2004-12-29' AND ost.date <= '2004-12-29'
GROUP BY ost.id, ost.orderId, ost.newStatus
HAVING ost.id = MAX(ost2.id)
Hello all,
I have a little problem that i seem to be at a loss at solving efficiently. Here's the situation
table : order_status_tracking
cols : id (int), orderId (int), newStatus(int), date(date), time(time)
each time an order gets a new status there is a row inserted in this table. now i...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.