A useful SQL help post includes the database engine and version, a small table definition, a few synthetic rows, the formatted query, the result you expected, and the result you got. Name whether the issue is missing rows, duplicates, ordering, or a calculation.
Use a SQL formatter to make joins and conditions readable, but do not assume formatting proves the query is valid. Remove customer names, emails, credentials, hostnames, and proprietary data before sharing. Test that your sample still reproduces the problem; if it does not, the detail you removed may matter.
A minimal example lets others explain the logic instead of guessing at your schema.