我的思路是事后循环合并,代码如下:
for (int i = Repeater1.Items.Count - 1; i > 0; i--)
{
HtmlTableCell oCell_previous = Repeater1.Items[i - 1].FindControl("tdDwmc") as HtmlTableCell;
HtmlTableCell oCell = Repeater1.Items[i].FindControl("tdDwmc") as HtmlTableCell; oCell.RowSpan = (oCell.RowSpan == -1) ? 1 : oCell.RowSpan;
oCell_previous.RowSpan = (oCell_previous.RowSpan == -1) ? 1 : oCell_previous.RowSpan; if (oCell.InnerText == oCell_previous.InnerText)
{
oCell.Visible = false;
oCell_previous.RowSpan += oCell.RowSpan;
}
}
for (int i = Repeater1.Items.Count - 1; i > 0; i--)
{
HtmlTableCell oCell_previous = Repeater1.Items[i - 1].FindControl("tdDwmc") as HtmlTableCell;
HtmlTableCell oCell = Repeater1.Items[i].FindControl("tdDwmc") as HtmlTableCell; oCell.RowSpan = (oCell.RowSpan == -1) ? 1 : oCell.RowSpan;
oCell_previous.RowSpan = (oCell_previous.RowSpan == -1) ? 1 : oCell_previous.RowSpan; if (oCell.InnerText == oCell_previous.InnerText)
{
oCell.Visible = false;
oCell_previous.RowSpan += oCell.RowSpan;
}
}
解决方案 »
- oracle与操作系统的兼容的问题
- Oracle Sql developer 乱码问题
- hp-unix下安装oracle9i遇到的问题
- ORACLE9.2里怎样通过日期计算筛选出符合条件的记录,请教具体SQL语句该怎么写?感激涕凌!
- oracle9i服务缺少OracleOraHome90ManagementServer、与OracleServiceORACLE项不知为什么???
- 忘记函数名了~速结贴~
- 请教一个初级问题,谢谢
- 高手们,请教一个算法
- 求助将oracle中的某一个数据库生成sql脚本文件的问题?
- 怎样在符合条件的纪录中只选中一条?
- Toad for Oracle中的登录界面上的问题
- weblogic发布程序时候calss文件夹下是空的
(gj varchar2(10), cs varchar2(10), qy varchar2(10), item varchar2(20), qty number );
select case when aaa.gj_rownum=1 then aaa.gj else null end gj ,
case when aaa.cs_rownum=1 then aaa.cs else null end cs
,case when aaa.qy_rownum=1 then aaa.qy else null end qy
,case when aaa.item_rownum=1 then aaa.item else null end item
,aaa.qty
from (
select aa.*, row_number()over(partition by aa.gj order by rownum ) gj_rownum
,row_number()over(partition by aa.cs order by rownum ) cs_rownum
,row_number()over(partition by aa.qy order by rownum ) qy_rownum
,row_number()over(partition by aa.item order by rownum ) item_rownum
from ( select * from cux_test a order by gj, cs,qy,item ) aa
) aaa;
如果你需要 知道合并的行数 稍加变通即可,还有我这查出的 结果 和你那稍微有差异,你如果仔细看了,就知道是排序不同而已造成的,至于其他可能不一样的地方,基本都大同小异,你稍加变通即可