Skip to main content

This version of the product is no longer supported, and this documentation is no longer updated regularly. See the latest version of this content.Opens in a new tab

Editing SQL

Now all we need to do is add “TOP 3” to SELECT clause of our SQL query and recompile the class.

—TopFilms—
TopFilms

   Query TopFilms() As %SQLQuery(CONTAINID = 1)
    {
        SELECT TOP 3 %ID,Description,Length,Rating,Title,Category->CategoryName 
        FROM Film
        WHERE (PlayingNow = 1)
        ORDER BY TicketsSold DESC
    }

The TOP 3 statement indicates that we are only interesting in the first 3 rows returned by this query.

FeedbackOpens in a new tab