Hi to all,
I have got a table with two fileds a type field and a timestamp field.
I would like to know if it is possible to get , with one query, the last in date for each type of record.
the query on this table:
Code:
+--------------+----------------+
| type | insertdate |
+--------------+----------------+
| 23 | 20040331101955 |
| 23 | 20040331102130 |
| 8 | 20031217173254 |
| 23 | 20040331101758 |
| 23 | 20040331101758 |
| 8 | 20031202114923 |
| 23 | 20040331101124 |
| 23 | 20040331101515 |
| 23 | 20040331100833 |
| 23 | 20040331101001 |
| 23 | 20040331100624 |
| 29 | 20040329150043 |
| 23 | 20040331100423 |
| 18 | 20040329094144 |
| 8 | 20031201105042 |
| 8 | 20031202115245 |
| 8 | 20031202115200 |
| 8 | 20031202123441 |
| 8 | 20031202124028 |
| 8 | 20040316105150 |
| 8 | 20031203000005 |
| 8 | 20031203100727 |
| 8 | 20031203100659 |
| 15 | 20031203101629 |
| 15 | 20031203101816 |
| 15 | 20031203101932 |
| 15 | 20031203102042 |
| 15 | 20031203102203 |
+--------------+----------------+
must give:
Code:
+--------------+----------------+
| type | insertdate |
+--------------+----------------+
| 23 | 20040331101758 |
| 29 | 20040329150043 |
| 18 | 20040329094144 |
| 8 | 20040316105150 |
| 15 | 20031203102203 |
+--------------+----------------+