I get the following error code:
Error Code: 1064. You have an error in your SQL syntax to use near \'THEN 0 ELSE (json_extract(sub.tr_confirmed, \'cnt_la