本文介绍了网格视图摘要报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用vb.net与visual studio 2005和sqlserver 2000

我有一个名为gb1的网格视图

有四个字体A,B,C, D

,其值类似于



I am using vb.net with visual studio 2005 and sqlserver 2000
I have a grid view named as gb1
WHICH HAS FOUR COLOUMNS A,B,C,D
and has the value like

A        B       C       D
1.0	2.0		1.0
2.0	1.0		3.0
-		2.0	





我想找个概要



LIKE



1.0 OCCURS = 3次

2.0 OCCURS = 3次

3.0 OCCURS = 1次





i找不到本摘要的逻辑。

请帮我解决这个问题。



I WANT TO FIND A SUMMARY

LIKE

1.0 OCCURS =3 TIMES
2.0 OCCURS =3 TIMES
3.0 OCCURS =1 TIMES


i don''t find the logic of this summary .
Please Help me regarding this condition.

推荐答案

select val,count(*) as Occurance from
(
    select a as Val from tblnm   _
    union all                     |
    select b from tblnm           |
    union all                      > this will get col a,b,c,d & then using union all merge all cols
    select c from tblnm           |
    union all                     |
    select d from tblnm          _|
) as t
group by val --here it grouped by val 



快乐编码!

:)


Happy Coding!
:)


这篇关于网格视图摘要报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 20:40