_________________________於我:有度,高手你呢?
表有一些:
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
指教
!
[解决办法]
看这么简单的界面设计,估计是数据库查询吧。
如果是SQL Server数据库查询,你大致可以写:
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
如果是复杂的ui,那么应该使用正规的ui组件开发方法。例如对于asp.net来说,首先开发一个ascx,给它参数field1,它就能产生这个field1对应的所有field2组合起来的界面(也许只显示一行简单的文字,也许很复杂的一个小程序),然后使用SQL语句“select distinct field1 from [数据表]”查询数据产生数据源绑定到DataList,并把这个ascx组件放入模板中,接受field1数据进行展示。
[解决办法]
...?