-1

This is what i'm trying to query for example:

Code Example:

SELECT  IF(MAIN.PROCESS = 0,"YES","NO") AS `SUCCESS_LOG`, FROM `XLSX_UPLOAD` AS MAIN  WHERE `SUCCESS_LOG` LIKE 'NO'

Unfortunately, I cannot find what I'm doing wrong other than it's something related to the WHERE condition search.

Gordon
  • 1,633
  • 3
  • 26
  • 45
  • You've managed to squeeze several errors into one tiny query. So it's hard to know where to begin. See https://meta.stackoverflow.com/questions/333952/why-should-i-provide-a-minimal-reproducible-example-for-a-very-simple-sql-query – Strawberry Jan 25 '21 at 21:34

1 Answers1

1

Since SUCCESS_LOG is not a real field, you need to use HAVING to check on it.

HAVING `SUCCESS_LOG` LIKE 'NO'

Though, in this query, I would just check your MAIN.PROCESS (again). That would probably be more efficient.

WHERE `MAIN`.`PROCESS` = 0
gen_Eric
  • 223,194
  • 41
  • 299
  • 337