一、concat()函数
1、功能:将多个字符串连接成一个字符串。
2、语法:concat(str1, str2,…)
返回结果为连接参数产生的字符串,如果有任何一个参数为null,则返回值为null。
select concat(id,",",name) as info from post;
例如:
java的实体类:
– 后端vo类
select CONCAT('private ',
CASE
WHEN DATA_TYPE = ‘varchar’ THEN 'String ’
WHEN DATA_TYPE = ‘int’ THEN 'Int ’
WHEN DATA_TYPE = ‘text’ THEN 'String ’
WHEN DATA_TYPE = ‘decimal’ THEN 'BigDecimal ’
WHEN DATA_TYPE = ‘datetime’ THEN 'Date ’
WHEN DATA_TYPE = ‘tinyint’ THEN 'Int ’
WHEN DATA_TYPE = ‘timestamp’ THEN 'Date ’
WHEN DATA_TYPE = ‘bigint’ THEN 'BigInteger ’
ELSE 'String ’ END,column_name,
‘; //’,COLUMN_COMMENT) vo
from information_schema.columns
where table_schema= ‘rmb_information_dev’ and table_name= ‘post’
结果: