Einzelnen Beitrag anzeigen
  #5  
Alt 07.08.2003, 12:43:43
diver-network diver-network ist offline
Junior Member
 
Registriert seit: Apr 2003
Ort: TÜ
Beiträge: 337
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
__________________
Delphine, Wale, Orcas und mee(h)r:
tauchen in Alor/Indonesien
http://www.alor-dive.com
Mit Zitat antworten