Update Statement zu Replace Into

Loki2

Erfahrenes Mitglied
Hallo,

kann ich in einem Replace Into Statement auch ein Join benutzen?

Ich habe folgendes Update Statement welches wunderbar funktioniert, das wäre aber noch besser wenn es ein Replace Into wäre aber das bekomme ich einfach nicht hin.

Update checkrevision as crev
LEFT JOIN(SELECT
checkrevision.*,
results.id as drID,
results.revision
FROM
checkrevision
INNER JOIN results
ON results.id = checkrevision.Id
WHERE (
checkrevision.Id IS NULL
OR checkrevision.lastrevision < results.revision
OR checkrevision.inProgress > 0
OR checkrevision.lastrevision IS NULL
)) as er ON crev.Id = drID set crev.lastrevision = er.revision WHERE (
crev.Id IS NULL
OR crev.lastrevision < er.revision
OR crev.inProgress > 0
OR crev.lastrevision IS NULL
)

Kann mir jemand weiterhelfen? Das wäre wirklich super.

Vielen Dank.

Gruß und so
Loki2
 
Zurück