Skip to main content

This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRIS, see the InterSystems IRIS Adoption Guide and the InterSystems IRIS In-Place Conversion Guide, both available on the WRC Distributions page (login required).

Previous sectionNext section

The TopCategory Query

Here is the TopCategory query. Add it to Cinema.Film.


Query TopCategory(P1 As %Library.String) As %Library.SQLQuery(CONTAINID = 1)
{
 SELECT TOP 3 ID, Description, Length, Rating, Title, Category->CategoryName
 FROM Film
 WHERE (PlayingNow = 1) AND (Category = :P1)
 ORDER BY TicketsSold DESC
}
Copy code to clipboard