Skip navigation

August MDX Puzzle Solution Revealed - 11 Aug 2000

Suppose you're developing an application that must provide users access to large amounts of information and you decide the best method is to display the data one page at a time (a page is 50 rows). If a user asks for unit sales to each customer during the four quarters of 1997, how would you write the query to return the first page of data? Remember, you want to return the customers in the order that they appear in the sales cube.

select \[1997\].Children on columns,
  Subset( \[Customers\].\[Name\].Members, 0, 50 ) on rows
from Sales
where (\[Unit Sales\])

This query uses the Subset function to return the first 50 customers on the rows.

TAGS: SQL
Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish