Moin,
habe mal schnell was zusammengeschrieben...
SQL-Code:
SELECT pers_name,
pers_vorname,
kath1.datum
AS kath1,
kath2.datum
AS kath2,
kath3.datum
AS kath3,
kath4.datum
AS kath4
FROM person
pe
LEFT JOIN (
SELECT pers_id,
MAX(kath1_datum)
AS datum
FROM pers_b_kath1 p
INNER JOIN kathegorie1 k
ON p.kath1_id = k.kath1_id
GROUP BY pers_id) kath1
ON pe.pers_id = kath1.pers_id
LEFT JOIN (
SELECT pers_id,
MAX(kath22_datum)
AS datum
FROM pers_b_kath2 p
INNER JOIN kathegorie21 k1
ON p.kath21_id = k1.kath21_id
INNER JOIN kathegorie22 k2
ON k1.kath22_id = k2.kath22_id
GROUP BY pers_id) kath2
ON pe.pers_id = kath2.pers_id
LEFT JOIN (
SELECT pers_id,
MAX(kath3_datum)
AS datum
FROM pers_b_kath3 p
INNER JOIN kathegorie3 k
ON p.kath3_id = k.kath3_id
GROUP BY pers_id) kath3
ON pe.pers_id = kath3.pers_id
LEFT JOIN (
SELECT pers_id,
MAX(kath4_datum)
AS datum
FROM pers_b_kath4 p
INNER JOIN kathegorie4 k
ON p.kath4_id = k.kath4_id
GROUP BY pers_id) kath4
ON pe.pers_id = kath4.pers_id
Vielleicht hilft dir das ja...
MfG
Thorsten