Do not do substitution for best equal field in HAVING conditions. It's not needed.
Attach a file by drag & drop or click to upload