MySQL Forums
Forum List  »  German

Re: Artikelnummer, Kundennummer, ... vergeben ??
Posted by: Wolfgang Moriske
Date: March 04, 2019 05:38AM

Moin!

Kommt vielleicht etwas spät ....


INSERT INTO Kunde (Kunden_nummer, Kunden_name)
VALUES (
(SELECT max(IFNULL(Kunden_nummer,0))+1 FROM kunde AS Kunden_nummer),
'Mustermann'
)

Entsprechend dann mit der Tabelle Artikel. Startet "Kunden_nummer", bzw. "Artikel_nummer" mit einem "vernünftigen" Wert kann das "IFNULL" entfallen.

Gruß
Wolfgang

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Artikelnummer, Kundennummer, ... vergeben ??
249
March 04, 2019 05:38AM


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.