Hi Stefan,
eine andere Möglichkeit, den letzten Eintrag zu finden ist mit dem "MAX-CONCAT"- Trick (in Google gefunden):
[ZITAT]
SELECT name,MAX(CONCAT(date,'|',town,'|',id)) FROM pa GROUP BY name;
Because 'date' now is the first part of the value that goes into MAX(), the
highest date will be found. This is not magic, it is because the mysql date
format (yyyy-mm-dd) will sort correctly in a string context. Dates stored in
a "dd-mm-yyyy" format would not work in this case: 31th january would be
'later than' 30th december.
Splitting the output column on the "|" character should be easy using any
scripting language.
[/ZITAT]
Ich habe obiges aber nicht getestet und kann Dir da leider keine Garantie geben, daß es wirklich klappt. Es klingt aber ziemlich logisch.
HTH,
Andy
|