「java行转列」java行转列sql
今天给各位分享java行转列的知识,其中也会对java行转列sql进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!
本文目录一览:
java大神来看看,求一个动态行转列的mysql语句并通过java发送
行转列????????????????
可以吗?????????????????
为什么要行转列????转过来只是显示的不一样而已啊。其他没什么不一样
java 行转列提供方法了吗
请问一下是excel的行转列吗 ? 写了个工具类解决了。
public MapString,String getColumnToRow(String path,int x,int y){
MapString,SetString map=new HashMap();
String[][] str=ExcelHelper.poiReader(path, null);
for(int i=1;istr.length;i++){
String cid=str[i][x];
String brandname=str[i][y];
if(map.get(cid)==null){
SetString set=new HashSet();
set.add(brandname);
map.put(cid, set);
}else{
SetString set=map.get(cid);
set.add(brandname);
map.put(cid, set);
}
}
MapString,String result=new HashMap();
for(String cid:map.keySet()){
SetString set=map.get(cid);
String xx="";
for(String s:set){
xx+=s+",";
}
result.put(cid, xx);
}
return result;
}
求高手解决 java接收从oracle数据库检索出的结果集如何把行列变换
直接一条SQL 可以搞定的 为什么还要放到 java 里面?
select decode(date,'201301',date,null) as one,decode(date,'201302',date,null) as two,decode(date,'201303',date,null) as three from table
unin all
select decode(date,'201301',name,null) as one,decode(date,'201302',name,null) as two,decode(date,'201301',name,null) as three from table
unin all
select decode(date,'201301',dizhi,null) as one,decode(date,'201302',dizhi,null) as two,decode(date,'201303',dizhi,null) as three from table
如果就这几条数据建议用我这种 SQL搞定。
如果很多跳数据 。还是java里面搞比较好。
如果是在页面上显示 最好写了
就直接 循环td表格
listtddate/td/list
listtdname/td/list
listtddizhi/td/list
关于java行转列和java行转列sql的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。