打印多个值mysql而不添加它们

时间:2014-04-15 19:02:48

标签: mysql session

让我说我有:

set @a = 1;
set @contents = @a;

set @a = 2;
set @contents = "Contents is " @contents + "," + @a;

我想让它显示:“内容是1,2”

我该怎么做?

1 个答案:

答案 0 :(得分:0)

我认为您正在寻找CONCAT()功能。

你可以像这样使用它:

set @a = 1;
set @contents = @a;

set @a = 2;
set @contents = concat("Contents is ", @contents, ",", @a);