query on query
От
Jayadevan M
Тема
query on query
Дата
Msg-id
3411BBAFF5A2244FA405CC91D9473A602369B076@PBOX2.ibsplc.com
Список
Дерево обсуждения
query on query Jayadevan M <jayadevan.maymala@ibsplc.com>
Re: query on query Luca Ferrari <fluca1978@infinito.it>
Re: query on query hubert depesz lubaczewski <depesz@depesz.com>
Re: query on query Jayadevan M <jayadevan.maymala@ibsplc.com>
Hi,
I have a table like this –
postgres=# \d m
Table "public.m"
Column | Type | Modifiers
--------+---------+-----------
id | integer |
marks | integer |
postgres=# select * from m;
id | marks
----+-------
1 | 27
2 | 37
3 | 17
4 | 27
5 | 18
(5 rows)
I wanted to get cumulative counts of students in different ranges – >90, > 80 , > 70 etc.
>10 5
>20 3
>30 1
>40 0
> 50 0
So each student may get counted many times, someone with 99 will be counted 10 times. Possible to do this with a fat query? The table will have many thousands of records.
Regards,
Jayadevan
DISCLAIMER: "The information in this e-mail and any attachment is intended only for the person to whom it is addressed and may contain confidential and/or privileged material. If you have received this e-mail in error, kindly contact the sender and destroy all copies of the original communication. IBS makes no warranty, express or implied, nor guarantees the accuracy, adequacy or completeness of the information contained in this email or any attachment and is not liable for any errors, defects, omissions, viruses or for resultant loss or damage, if any, direct or indirect."
В списке pgsql-general по дате отправления
От: guxiaobo1982
Дата: