I hope someone can help. I have a table that has serveral records with
the same name but unique datestamps. I need to show only the records
with the latest datestamp associated with them. I am enclosing the sql
that I am working with in hopes that someone can see the problem that I
can't. I crashes at the GROUP BY line.
$sql = "
P1.siname, P1.imin, P1.siti, P1.sito, P1.sireason, P1.id, P1.date,
P2.siname, MAX(P2.id) AS latest_time
FROM $table_name AS P1
INNER JOIN $table_name AS P2
GROUP BY P2.siname AS P3
ON P1.id = P3.latest_time
Any help will be appreciated.
Hank Schassen, ACI
|• INNER JOIN problem||hschassen||3 Jan|