两个办法,一是建立一个整型数组,把几个值用循环分别放进去。
这个方法要注意循环一次之后用break跳出来,否则会把所有的重写一次。
二就方便了,接到数值之后,可以把数值放在Vector数组里,后面接出来就可以了。
这个方法要注意循环一次之后用break跳出来,否则会把所有的重写一次。
二就方便了,接到数值之后,可以把数值放在Vector数组里,后面接出来就可以了。
解决方案 »
- 求助:在将文本文件插入表中时如何同时在每行最后一个字段插入一指定日期?
- 求SQL语句???
- 再次请问zjcxc(邹建)bcp的问题
- 把数据库导出到桌面上,该如何进行?
- ms-sql7.0,数据库所在的D盘空间已经满,我想把她转移到H盘,最好该怎么做呢?急!!
- 请问我这个存储过程错在哪里?
- 一定给分.
- 如何隐藏数据库中的系统表?
- 请问,原来的数据类型是 nvarchar(255),后来知道255是字符长度,觉得用不了那么多,想改变成10,请问,会丢失数据吗?谢谢
- 100元人民币求助!能成功在REDHAT LINUX或SOLARISE上安装ORACLE8I的高手!帮帮忙吧!!
- 一个数据库的连接问题。请教,在线等。急
- 请求叫一个统计的问题
select
燃料 = rlzl,
测量1次 = sum(case clcs when 1 then 1 else 0 end),
测量2次 = sum(case clcs when 2 then 1 else 0 end),
测量3次 = sum(case clcs when 3 then 1 else 0 end),
测量4次 = sum(case clcs when 4 then 1 else 0 end),
测量5次 = sum(case clcs when 5 then 1 else 0 end)
from
cardata_doc
where
rlzl='B'
group by rlzl--否则:
select
燃料 = rlzl,
测量1次 = sum(case when clcs>0 then 1 else 0 end),
测量2次 = sum(case when clcs>1 then 1 else 0 end),
测量3次 = sum(case when clcs>2 then 1 else 0 end),
测量4次 = sum(case when clcs>3 then 1 else 0 end),
测量5次 = sum(case when clcs>4 then 1 else 0 end)
from
cardata_doc
where
rlzl='B'
group by rlzl
ResultSet rs = stmt.executeQuery(sql);
int n[]=new int[5];
for(int i=0;i<5;i++){
if(rs.next()){
n[i]=rs.getInt("num");
break;}
}
这样可以把count(*)的数值放在num里,再取出来放在数组n[5]里使用Vector方法跟着差不多,换一下数组就可以了