How can I use SET in MYSQL to combine 2 values?

I wanted to SET a value into a VARCHAR but I don't understand how to combine it.

DECLARE id INTEGER;
DECLAR action VARCHAR(100);
SET id = (SELECT MAX(ID) FROM Test.Test);
SET action = "This is a test" + id;

Somehow I am losing the textpart "This is a test". Is this normal behaviour for MySQL, am I doing something wrong ?

Upvotes: 0

Views: 41

Answers (1)

Kejun Deng
Kejun Deng

Reputation: 26

You can use MySQL functions. SET action = CONCAT('This is a test',id);

Upvotes: 1

Related Questions