Scenario The customer-support lead starts every morning by checking which customers have an urgent problem that nobody has resolved yet. She does not need to see every Case, only the list of Accounts that need attention.
Task
Write one SOQL query on Account that returns every Account having at least one Case that is both:
Priority = 'High', andStatus is not Closed.An Account must appear only once, even if it has several matching Cases. Sort the result by Name ascending.
Expected output
One row per qualifying Account with two columns: Id and Name.
Example
Use a semi-join (WHERE Id IN (SELECT AccountId FROM Case ...)) so each Account appears only once, even if it has several matching Cases. Open means Status is not 'Closed'. Order by Name ascending.
2 row(s), order checked
| # | Id | Name |
|---|---|---|
| 1 | 001000000000001AAA | Account 1 |
| 2 | 001000000000002AAA | Account 2 |