1、错误原因
2、错误原因
上面左侧图是SQL语句查询出来的结果,右侧是导出Excel展示的数据,结果发现两者竟然不一致
3、解决办法
拼接的SQL:
sql.append("SELECT CONCAT((@rowNum := @rowNum + 1),'') AS rownum,t.* FROM(");
Map<string,object> map=(Map<string, object="">) data.get(i); HSSFRow datarow = sheet.createRow(i+1); HSSFCell cell0 = datarow.createCell(0); HSSFRichTextString t0 = new HSSFRichTextString((String)map.get("rownum")+""); cell0.setCellValue(t0);</string,></string,object>
Map<string,object> map=(Map<string, object="">) data.get(i); HSSFRow datarow = sheet.createRow(i+1); HSSFCell cell0 = datarow.createCell(0); HSSFRichTextString t0 = new HSSFRichTextString(map.get("rownum")+""); cell0.setCellValue(t0); </string,></string,object>