表裡有這樣一些記錄:
10點 10:50的火車
11點 null
12點 null
13點 null
14點 null
15點 null
16點 記得打電話提醒下火車
16點 test
16點 tt
16點 笑話
17點 sdfdsf 請部怎樣顯示成:
10點 10:50的火車
11點 null
12點 null
13點 null
14點 null
15點 null
16點 1,記得打電話提醒下火車;2,test;3,tt;4,笑話;
17點 sdfdsf 請指教
謝謝!
10點 10:50的火車
11點 null
12點 null
13點 null
14點 null
15點 null
16點 記得打電話提醒下火車
16點 test
16點 tt
16點 笑話
17點 sdfdsf 請部怎樣顯示成:
10點 10:50的火車
11點 null
12點 null
13點 null
14點 null
15點 null
16點 1,記得打電話提醒下火車;2,test;3,tt;4,笑話;
17點 sdfdsf 請指教
謝謝!
解决方案 »
- asp.net+Extjs自动生成工具
- Razor 后台如何动态调用javascript,如(Page.RegisterStartupScript)
- asp.net中大家是如何进行分页和排序功能的~
- fckeditor显示问题
- FCKeditor编辑后存库问题
- .net IDE崩溃的问题
- 多条SQL查询返回到一个DataSet的问题
- 在datagrid中某列插入dropdownlist,请问怎么对dropdownlist绑定数据
- 多个表联动
- 安装FRONTPAGE扩展的问题。
- shtml页面中include进来的htm页面文字都出现乱码!!!!
- 怎样在html代码中调用C#中的一个类.比如调用SqlClient
不知道有没有sql高手直接读成这个样子?
insert @t(field1) select distinct field1 from [数据表]
update t set
field2=case t.field2 when null then s.field2 else t.field2+','+s.field2
from @t as t
inner join [数据表] as s on t.field1=s.field1
where s.field2 is not null
select * from @t
如果是复杂的ui,那么应该使用正规的ui组件开发方法。例如对于asp.net来说,首先开发一个ascx,给它参数field1,它就能产生这个field1对应的所有field2组合起来的界面(也许只显示一行简单的文字,也许很复杂的一个小程序),然后使用SQL语句“select distinct field1 from [数据表]”查询数据产生数据源绑定到DataList,并把这个ascx组件放入模板中,接受field1数据进行展示。
@"declare @t(field1 nvarchar(30) primary key,field2 nvarchar(3000))
insert @t(field1) select distinct field1 from [数据表]
update t set
field2=case t.field2 when null then s.field2 else t.field2+','+s.field2
from @t as t
inner join [数据表] as s on t.field1=s.field1
where s.field2 is not null
select * from @t", connect);