Frank (no reg): Anfängerproblem GROUP BY

Beitrag lesen

Hallo,

du benötigst MAX in einer korrelierenden Unterabfrage um dein Problem auf eine mögliche Weise zu lösen, GROUP BY Name, MAX(timestamp) und einen JOIN um es auf eine andere mögliche Weise zu lösen.

Gib mir Name, Preis und Timestamp wo Timestamp gleich dem maximalen Timestamp je Name ist ...

SELECT DISTINCT t1.*
   FROM tabelle AS t1
   WHERE timestamp = (SELECT MAX(t2.timestamp)
                                       FROM tabelle AS t2
                                       WHERE t2.Name = t1.Name)

Cheers, Frank