MySQL Forums
Forum List  »  German

Re: Select * from Variable
Posted by: Martin Müller
Date: July 10, 2019 04:58AM

Ich habe nun folgenden Code:

--------------------------------------------------------------------------
SET @table = CONCAT("Backup_",(SELECT DATE_FORMAT(CURDATE(), '%Y_%m')));

SET @tab_anw = CONCAT_WS(" ", "SELECT * FROM",@table);

PREPARE tab_aus FROM @tab_anw;

EXECUTE tab_aus
--------------------------------------------------------------------------

Die Tabelle lautet nun "Backup_2019_07"

Wie kann ich jetzt einen Monat zurück? also "Backup_2019_06"

Vielen Dank für Eure unterstützung

Options: ReplyQuote


Subject
Views
Written By
Posted
422
June 25, 2019 03:34AM
Re: Select * from Variable
133
July 10, 2019 04:58AM


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.