0

Not able to run/resolve this below query in mysql 8.0

Query: sum(decode(billflage,'N',0,instlamt) - nvl(recdamt,0)) WHERE DUEDATE < SYSDATE

with value: sum(decode('Y','N',0,2322 - nvl(2322,0))) Where 8/5/2016 12:00:00 < 30/1/2020 12:00:00

Please provide the output or how it will work in mysql 8.0

Devendra
  • 219
  • 2
  • 22
  • Are you using MySQL or Oracle? – jarlh Jan 30 '20 at 07:29
  • In MySQL `decode()` is [a function for decrypting encoded strings](https://www.geeksforgeeks.org/mysql-decode-function/). This is different from Oracle, where `decode()` is a form of CASE statement. Use the solutions in the linked question to resolve your problem. – APC Jan 30 '20 at 07:37
  • @jarlh - I think the Seeker is trying to convert an Oracle decode() to MySQL. – APC Jan 30 '20 at 07:47

0 Answers0