Concat two column in a select statement sql server 2005

前端 未结 3 1184
野趣味
野趣味 2021-01-13 08:59

How to Concat two column in a select statement sql server 2005?

Here is my statement Select FirstName,secondName from Table...

Now i did try con

相关标签:
3条回答
  • 2021-01-13 09:14

    If one of your fields is numeric then you can cast it to a string as follows:

    SELECT FirstName + ISNULL(' ' + SecondName, '') + ' age(' + CONVERT(nvarchar,age) + ')' from Table
    
    0 讨论(0)
  • 2021-01-13 09:15

    do like this :

     select cast( FirstName as varchar)+' '+cast( secondName as varchar) from table
    
    0 讨论(0)
  • 2021-01-13 09:23

    SELECT FirstName + ISNULL(' ' + SecondName, '') from Table

    0 讨论(0)
提交回复
热议问题