MySQL Forums
Forum List  »  German

Update um Count
Posted by: Lucas Buchwald
Date: July 14, 2011 06:54AM

Ich habe 3 Tabellen in meiner Datenbank,
hier erstmal die Query

UPDATE tblErgebnis SET ColumnA= ColumnA + 1 WHERE ColumnB IN (
SELECT ColumnB FROM tblData WHERE ColumnC IN (
SELECT ColumnC from tblGehalt));

Also, die Query soll ColumnA um 1 erhöhen, wenn ColumnB in der Unterabfrage vorkommt.
Wenn die Bedingungen zutreffen, erhöht sich auch der Wert in der Datenbank um 1.
Wenn aber mehr als einmal die Bedingung zutrifft, soll sich auch der Wert dementsprechend erhöhen, und das passiert bei mir leider nicht.
Wie kann ich Count() um die Anzahl der Treffer hinzuzuaddieren?

MfG Lucas

Options: ReplyQuote


Subject
Views
Written By
Posted
Update um Count
2749
July 14, 2011 06:54AM
1143
July 17, 2011 03:24PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.