Re: Return 30% of results?

Поиск
Список
Период
Сортировка
От Martin Gainty
Тема Re: Return 30% of results?
Дата
Msg-id BLU142-W185904FB8D791C9A2F6948AEE00@phx.gbl
обсуждение исходный текст
Ответ на Return 30% of results?  (Nick <nboutelier@gmail.com>)
Ответы Re: Return 30% of results?  (David Fetter <david@fetter.org>)
Список pgsql-general
//Display the top 40 % of rows in BB_DEPARTMENT

SQL> select ROWNUM,ID FROM EMPLOYEES WHERE ROWNUM < .3*(SELECT COUNT(ID) FROM BB
_DEPARTMENT) GROUP BY ROWNUM,ID;

ROWNUM
----------
1
HTH
Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.





> From: nboutelier@gmail.com
> Subject: [GENERAL] Return 30% of results?
> Date: Fri, 18 Sep 2009 14:31:29 -0700
> To: pgsql-general@postgresql.org
>
> Is there a way to return a percentage of the rows found? I tried
> window functions but get an error...
>
> ERROR: syntax error at or near "OVER"
>
> SELECT id, cume_dist FROM (
> SELECT id, cume_dist() OVER (ORDER BY id) FROM employees
> ) s
> WHERE cume_dist < 0.3
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general


Hotmail: Powerful Free email with security by Microsoft. Get it now.

В списке pgsql-general по дате отправления:

Предыдущее
От: Devrim GÜNDÜZ
Дата:
Сообщение: Re: MD5 sum mismatch in source rpm
Следующее
От: David Fetter
Дата:
Сообщение: Re: Return 30% of results?