I create a report in TIBCO, insert the SQL expression there:

SELECT date_trunc('hour', header.input_time), count(header.id) AS total, count(CASE WHEN (header.decision = 'REFUSED') THEN 1 ELSE NULL END) AS refused from test_bank_schema."TRANSACTION_HEADER" AS header where header.history IS TRUE group by date_trunc('hour', header.input_time) order by date_trunc('hour', header.input_time) asc; 

Which without errors is executed from IDEA.

And in TIBCO he emphasizes a bunch of errors:

enter image description here

And accordingly does not want to be executed.

  • The problem was in the second count. It was necessary to write it a little differently: count (CASE header.decision WHEN 'REFUSED' THEN 1 ELSE null END) - Andrey Gornostayev

0