Skip to navigation
How to get the first order record form a mysql orders table
19.11.15
the table orders has a user_id and a date column SELECT o1.* FROM orders o1 INNER JOIN ( SELECT min(date) MinDate,user_id FROM orders GROUP BY user_id ) o2 ON o1.user_id = o2.user_id AND o1.date = o2.MinDate ORDER BY o1.date asc
http://stackoverflow.com/questions/14770671/mysql-order-by-before-group-by
Reply
Anonymous
Information Epoch 1773082813
Save trees.
Home
Notebook
Contact us