Registriert seit: 31. Mär 2004
Ort: Frankfurt am Main
1.511 Beiträge
Delphi 7 Architect
|
AW: Bekomme Inner Joins nicht hin
18. Dez 2018, 18:05
Code:
SELECT
id, Daten1, Daten2, MAX(changeTimestamp) changeTimestamp, changeComment
FROM Item a INNER JOIN (
SELECT id AS fkey, MAX(changeTimestamp) changeTimestamp, changeComment
FROM Item_Rev
GROUP BY id, changeComment
) b ON (a.rev = b.fkey)
GROUP BY id, Daten1, Daten2, changeComment
vielleicht so:
Code:
SELECT
a.rev, a.Daten1, a.Daten2, MAX(b.changeTimestamp) changeTimestamp, b.changeComment
FROM Item a
INNER JOIN Item_Rev b ON (a.rev = b.id)
GROUP BY a.Daten1, a.Daten2, b.changeComment
|
|
Zitat
|