[postgis-users] Rounding up timestamps in postgresql

Newcomb, Doug doug_newcomb at fws.gov
Wed Dec 26 06:31:24 PST 2012


>From the example at
http://www.w3resource.com/PostgreSQL/postgresql-sum-function.php

SELECT SUM ( DISTINCT salary) AS "Total Salary"
FROM employee
WHERE deptno=15;
>From the example at , http://w3resource.com/PostgreSQL/where.php

SELECT *
FROM actor
WHERE actor_age>26  and
http://www.postgresql.org/docs/9.1/static/functions-comparison.html

I imagine you would have a counter for seconds and look for a value of
Utc_Time that is greter than or equal to  the current second and the next
second ( counter +1)
i.e.

Utc_Time >= current second and Utc_Time < next second

On Fri, Dec 21, 2012 at 8:10 AM, tasneem dewaswala <tasneem.europe at gmail.com
> wrote:

> Hello,
>
> I have a table consisting of following columns and data
>
> *Msg_count     Latitude         Longitude             Utc_Time*
> 16              56.6650356667  12.8772211667         142640
> 24              56.6650415       12.8772395               142640.25
> 35              56.6650475       12.8772581667          142640.5
> 26              56.665053         12.8772778333          142640.75
> 23              56.6650593333  12.8772976667          142641
> 26              56.6650656667  12.8773183333          142641.25
> 25              56.665072         12.8773388333          142641.5
> 15              56.6650785       12.8773598333           142641.75
>
> i need to find out sum of messages transmitted every second.
> For eg. when i group (142640, 142640.25, 142640.5, 142640.75) it makes 1
> sec and total number of messages sent during this interval are
> 16+24+35+26=101
>
> I don't know how can do this using a query.
>
> Does anyone have suggestion
>
> Regards..
> Tasha
>
>
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
>


-- 
Doug Newcomb
USFWS
Raleigh, NC
919-856-4520 ext. 14 doug_newcomb at fws.gov
---------------------------------------------------------------------------------------------------------
The opinions I express are my own and are not representative of the
official policy of the U.S.Fish and Wildlife Service or Dept. of the
Interior.   Life is too short for undocumented, proprietary data formats.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20121226/1d387527/attachment.html>


More information about the postgis-users mailing list