select count(f.forward_letter_id) warning from app_letter_forwarding f, app_letter l where f.forward_letter_id = l.letter_id and f.forward_status != 'DIBACA' and ( f.forward_user_id = :user_id OR ( f.forward_position_id in ( select position_id from app_position_init where user_id = AND position_type = '1' ) ) ) | SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AND position_type = '1' ...' at line 11