Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2003

    Unanswered: Top N Approximation

    I am trying to create an approximation to the Top N commend found in the other relational database products, but not found in ASE12.5. What complicates this Top N is that it is grouped along a primary and secondary grouping category, and I want the Top N to be performed on the Secondary Group.

    For example:
    You have a table that contains facility_id, period, category_id, num1, num2, num3,num4

    What I want to be able to do is get a TopN report where for every Facility based on aggregates of the num fields.

  2. #2
    Join Date
    Mar 2003

    You can use

    set @@rowcount N /* where N should be number or rows */

    and then your query...

    or you can do

    set @@rowcount N

    select * into #tmp from your_table

    and then run query on #tmp

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts