Re: Postgresql and Top N Analysis?

From: Larry Rosenman <ler(at)lerctr(dot)org>
To: Katka a Daniel Dunajsky <daniel_katka(at)hotmail(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Postgresql and Top N Analysis?
Date: 2003-05-13 21:36:07
Message-ID: 372780000.1052861767@lerlaptop.iadfw.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

--On Tuesday, May 13, 2003 15:32:57 -0600 Katka a Daniel Dunajsky
<daniel_katka(at)hotmail(dot)com> wrote:

> Hello all,
>
> Can anyone give me an hit how to do Top 'N' Analysis in postgresql (if it
> is possible)? I see that postgresql does not have an pseudocolumn rownum,
> therefore I can't use query like this:
>
> SELECT *
> FROM (SELECT DISTINCT session_type_id FROM user_sessions ORDER BY
> session_type_id) as dummy GROUP BY dummy;
>
> Thank you for your time.

look at the LIMIT parameter of SELECT, If I'm reading you right.

--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: ler(at)lerctr(dot)org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2003-05-13 23:22:20 Re: Ok, how do I debug THIS?
Previous Message Katka a Daniel Dunajsky 2003-05-13 21:32:57 Postgresql and Top N Analysis?