本文介绍了将列句分成多行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

查询



Query

select top(1) p.projectname,s.sitename,(select 'Contact Person :'+ s.ContactPerson+';'+'Contact Number: '+s.ContactNumber+';'+'Email_Id: '+s.ContactEmailId+';'+'Site Address'+s.SiteAddress+';')as ContactDetails ,s.RosteringDays,'Weekly Off:'= CASE WHEN w.weekday =  1 THEN 'Sunday' when w.weekday=2 then 'Monday'    when w.weekday=3 then 'Tuesday' when w.WeekDay=4 then 'Wensday' when w.weekday=5 then 'Thursday' when w.weekday=6 then 'Friday'  when w.weekday=7 then 'Saturday' else '' end from tbl_project_site s inner join tbl_Project_SiteWeeklyOff w on w.siteid=s.siteid inner join tbl_project p on p.projectid=s.projectid where s.siteid=w.siteid





输出这是一排o / p

印度海外|安泰里|联系人:abc;联系电话:8957626526; Email_Id:[email protected];网站地址mumbai; | 9 |星期二





i希望单独行中的联系方式

表示我想要输出如下,是这可能吗?如果有人知道怎么做,请回答它.........

|印度海外| Andheri |联系人:abc; | 9 |星期二

| | |联系电话:8957626526; | |

| | | Email_Id:[email protected]; | |

| | |网站地址孟买; | |



Output this is a single row o/p
Indian Overseas|Andheri|Contact Person :abc;Contact Number: 8957626526;Email_Id: [email protected];Site Address mumbai;|9|Tuesday


i want contact details in a seperate row
means i want output like below ,is this possible? if anyone know hw to do it please answer it.........
|Indian Overseas|Andheri |Contact Person :abc; | 9 |Tuesday
| | |Contact Number: 8957626526;| |
| | | Email_Id: [email protected]; | |
| | | Site Address mumbai; | |

推荐答案



这篇关于将列句分成多行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 13:41