我正在尝试运行此查询,但它什么也没返回。它将用户输入作为查询的变量。我必须提到一件事,那就是用户何时离开batch_number
s textbox empty, the query should return all the batches of the
organization_ID`。这是查询:
SELECT Nvl(a.ORGANIZATION_ID, ' '),
Nvl(a.FILE_TYPE, ' '),
Nvl(a.BATCH_NUMBER, ' '),
Nvl(a.FILE_NAME, ' '),
Nvl(TOTAL_ANB_RECORDS, 0)
FROM PAYMENT B,
PAYROLL A
WHERE b.ORGANIZATION_ID = a.ORGANIZATION_ID
AND a.ORGANIZATION_ID = '1176'
AND PAYMENT_TYPE = '1'
AND Nvl(PAYMENT_STATUS, 'a') = '5'
AND ( BM_BATCH_INDC = '0'
OR BM_BATCH_INDC = '1'
OR BM_BATCH_INDC = '3' )
AND b.FILE_TYPE = a.FILE_TYPE
AND b.FILE_BATCH_NUMBER = a.BATCH_NUMBER
AND ( b.FILE_BATCH_NUMBER = '"+textBox.text.ToString()+"'
OR b.FILE_BATCH_NUMBER IS NULL )
AND b.PAYMENT_PATH = '01';