Du kan have mere end én kolonne angivet for GROUP BY
prøv dette:
SELECT user_id, order_id, MAX(order_date) FROM orders
GROUP BY order_id, user_id
HAVING
MAX(order_date) < '2012-01-20'
Du kan have mere end én kolonne angivet for GROUP BY
prøv dette:
SELECT user_id, order_id, MAX(order_date) FROM orders
GROUP BY order_id, user_id
HAVING
MAX(order_date) < '2012-01-20'