I have the following query. I'd need to pick only the oldest rows (by DATE column). keeping my conditions (where and group by)
SELECT
table.*
from database.table
where views = $views AND sales>23
group by
name
to be a bit clearer it is like passing frm this first table
+--------------------+-----------+--------------------+
| USER | id | DATE |
+--------------------+-----------+--------------------+
| sue1 | 494 | 2014-06-23 12:08:29|
| sue2 | 494 | 2014-06-25 12:08:29|
| sue3 | 494 | 2014-06-27 12:08:29|
| sue4 | 520 | 2014-06-26 12:08:29|
| sue5 | 570 | 2014-06-24 12:08:29|
+--------------------+-----------+--------------------+
to this second one
+--------------------+-----------+--------------------+
| USER | id | DATE |
+--------------------+-----------+--------------------+
| sue3 | 494 | 2014-06-27 12:08:29|
| sue4 | 520 | 2014-06-26 12:08:29|
| sue5 | 570 | 2014-06-24 12:08:29|
+--------------------+-----------+--------------------+
marko.c