MySQL Error Message
Statement requires a transform of a subquery to a non-SET
operation (like IN2EXISTS, or subquery-to-LATERAL-derived-table).
This is not allowed with optimizer switch ‘subquery_to_derived’ on
Reason for the Error
ER_SUBQUERY_TRANSFORM_REJECTED was
added in 8.0.21.