请帮忙 !!!!!!!在数据库中,我有 2 行带有此查询。
SELECT D.DEALER_CODE
FROM SCOTT.T_DEALERSHIP D,SCOTT.T_DEALER_BILLING DB
WHERE D.DEALER_CODE = DB.DEALER_CODE
AND DEALER_NAME LIKE 'XTIME%'
AND (RNR_CUST_NUM = '546' OR RNR_CUST_NUM = '43356'OR RNR_CUST_NUM = '7637055' OR RNR_CUST_NUM ='7637055' OR RNR_CUST_NUM IS NULL)
AND (RCI_STORE_NUMBER IS NULL OR RCI_STORE_NUMBER = '05')
AND (RCI_AREA_NUMBER = '01'OR RCI_AREA_NUMBER IS NULL)
AND (RCI_DEALER_NUMBER IS NULL AND DEALER_Address1 LIKE UPPER('1500 ORACLE%')
AND DEALER_CITY =UPPER('BAKERSFIELD') AND DEALER_ZIP LIKE'6%')
使用下面的代码,当数据库中有 2 条记录时,我只得到 1 行。当数据库中只有一条记录时它可以工作,但当有更多记录时则不行。方法也rs.last()
被跳过并退出结果集。我必须评论它才能执行一条记录。我不想使用COUNT
.
ResultSet rs = stmt.executeQuery(sql1);
System.out.println("" + sql1);
while(rs.next()) {
rs.last();
int Rows = rs.getRow();
System.out.println("Rows are " + Rows);
}