Search Postgresql Archives

Get sum of sums

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi List,

I have the following table that has netflow data. I can get the top ten receivers by the query below - but I would also like to get
at the same time a grand total of the RX Bytes. I am not exactly sure how to do it. This is with version 8.4.

select ip_dst as "Receiver" ,sum(bytes) as "RX Bytes" from acct_v9 where stamp_inserted >= '2016-04-26' and stamp_inserted <= '2016-04-30' and tag=246 group by ip_dst  order by "RX Bytes" desc limit 10;
    Receiver    |  RX Bytes  
----------------+-------------
 172.24.110.93  | 40363536915
 172.24.110.81  |  6496041533
 172.24.110.123 |  4891514009
 172.24.16.10   |  4540333516
 172.24.110.151 |  4101253631
 192.168.198.71 |  3303066724
 172.24.110.121 |  2529532947
 172.24.110.101 |  2506527294
 172.21.64.99   |  2472842640
 172.24.110.83  |  2232550271


Thanks,
Steve
--


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux