我的程序中有以下 SQL 语句:
"SELECT ANTAL_KALD,BESVARET_25_SEK,((BESVARET_25_SEK/nullif(ANTAL_KALD,0))*100) as answer_percent,TIDSPUNKT,QUEUE "
+"FROM KS_DRIFT.PERO_NKM_KØ_OVERSIGT WHERE TIDSPUNKT BETWEEN '"+start.getYear()+"-"+start.getMonthOfYear()+"-"+start.getDayOfMonth()+
"' AND '"+end.getYear()+"-"+end.getMonthOfYear()+"-"+end.getDayOfMonth()+
"'";
这没有给我任何结果集
测试System.out.println(rs.next())
是false
但是,当我在我的数据库中写入以下内容时:
select QUEUE,
ANTAL_KALD,
BESVARET_25_SEK,
((BESVARET_25_SEK/nullif(ANTAL_KALD,0))*100) as answer_percent,
TIDSPUNKT
from KS_DRIFT.PERO_NKM_KØ_OVERSIGT Where TIDSPUNKT BETWEEN '2012-12-01' AND '2012-12-02' ORDER BY QUEUE
我得到了结果.. 那么问题是什么?它没有给我错误或任何东西