(选择pname +''+来自表的注释)......尽管包含数据的表,但返回所有零值

时间:2017-06-29 17:52:58

标签: mysql sql

select pname +''+ comment from table

执行上面的查询后,它返回包含所有零值的结果为什么?

2 个答案:

答案 0 :(得分:1)

你可以使用concat()

select concat(pname, ' ' , comment ) from my_table;

答案 1 :(得分:0)

简单,它也可以在没有lastName questionStem Answer -------------------------------------------------------- Smith Favorite color? Black Jones Favorite color? Did not answer Aki Favorite color? Red Smith Your age? 22 Jones Your age? 71 Aki Your age? Did not answer

的情况下工作
concate funtion
  

参考: https://www.w3schools.com/sql/trysql.asp?filename=trysql_select_alias_column2&ss=-1