合并同一表中的4列并在下一行中显示 [英] combine 4 column in the same table and display in next line

查看:53
本文介绍了合并同一表中的4列并在下一行中显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我需要合并多个列并在下一行显示它.

例如:

sno名称地址公司所在城市
1 Bujju India Advent Delhi

我需要得到的结果是

个人信息

Bujju,
印度,
来临,
德里

我尝试以下查询:

Hello All,

I need to combine more than one column and display it next line.

eg:

sno name address company city
1 Bujju India Advent Delhi

I need to get the result as

Personal Info

Bujju,
India,
Advent,
Delhi

I try this Query:

select isnull(Performance.name,'')  + CHAR(13) + 
       isnull(Performance.address,'') + CHAR(13) +
       isnull(Performance.company,'') +  CHAR(13)+
       isnull(Performance.city,'')
from Performance



但我在同一行中得到了结果

帮助pl解决我的问题

谢谢

问候,
Praveen



But I got the result in the same line

Help pl to solve my problem

Thanks

Regards,
Praveen

推荐答案

CHAR(13)是回车符,因此您可以在多行中获得答案.
如果要将整个集合放在同一行中,请使用char(10).
CHAR(13) is a carriage return and hence you get the answer in multiple lines.
If you want the entire set in the same line, use char(10).


嘿,
试试这个
Hey,
try this
select isnull(Performance.name,'')   +','+
         isnull(Performance.address,'') +','+
         isnull(Performance.company,'') +','+
         isnull(Performance.city,'')
from Performance



祝你好运



Best luck


这篇关于合并同一表中的4列并在下一行中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆