Instead of a list, a grid can be used in a query. The Grid query function is otherwise identical to a List query.
For implementation information, see Queries.