MYSQL:char字段在select语句中被截断

时间:2014-09-30 14:45:23

标签: mysql string varchar truncate string-length

我有一个MySQL查询,如下所示:

select 'abcdefghij' as stringvar
....
union select
select 'aaaaaabbbbbfffffkkkkkk' as stringvar
...
union
select 'ghghgjk' as stringvar'
....;

stringvar被截断了,我试图找出如何防止它。有没有办法在select语句中指定长度?

提前致谢!

椰油

1 个答案:

答案 0 :(得分:0)

你可以CAST(<String> AS VARCHAR(MAX))