<div>From the example at</div><a href="http://www.w3resource.com/PostgreSQL/postgresql-sum-function.php">http://www.w3resource.com/PostgreSQL/postgresql-sum-function.php</a><div><br></div><div><li class="alt"><span class="keyword">SELECT</span> <span class="func">SUM</span> ( <span class="keyword">DISTINCT</span> salary) <span class="keyword">AS</span> <span class="string">"Total Salary"</span> </li>
<li class=""><span class="keyword">FROM</span> employee </li><li class="alt"><span class="keyword">WHERE</span> deptno=15;</li><br>>From the example at , <a href="http://w3resource.com/PostgreSQL/where.php">http://w3resource.com/PostgreSQL/where.php</a><br>
<br><li class="alt"><span class="keyword">SELECT</span> * </li><li class=""><span class="keyword">FROM</span> actor </li><li class="alt"><span class="keyword">WHERE</span> actor_age>26 </li> and<br><a href="http://www.postgresql.org/docs/9.1/static/functions-comparison.html">http://www.postgresql.org/docs/9.1/static/functions-comparison.html</a></div>
<div><br></div><div>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)</div><div>i.e.</div><div><br></div>
<div>Utc_Time >= current second and Utc_Time < next second<br><br><div class="gmail_quote">On Fri, Dec 21, 2012 at 8:10 AM, tasneem dewaswala <span dir="ltr"><<a href="mailto:tasneem.europe@gmail.com" target="_blank">tasneem.europe@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<div><br></div><div>I have a table consisting of following columns and data</div><div><br></div><div><b>Msg_count Latitude Longitude Utc_Time</b></div>
<div><div>16 56.6650356667 12.8772211667 142640</div>
<div>24 56.6650415 12.8772395 142640.25</div><div>35 56.6650475 12.8772581667 142640.5</div><div>26 56.665053 12.8772778333 142640.75</div>
<div>23 56.6650593333 12.8772976667 142641</div><div>26 56.6650656667 12.8773183333 142641.25</div><div>25 56.665072 12.8773388333 142641.5</div>
<div>15 56.6650785 12.8773598333 142641.75</div></div><div><br></div><div>i need to find out sum of messages transmitted every second.</div><div>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 </div>
<div>16+24+35+26=101</div><div><br></div><div>I don't know how can do this using a query.</div><div><br></div><div>Does anyone have suggestion</div><div><br></div><div>Regards..</div><div>Tasha</div><div><br></div><div>
<br></div><div><br></div><div><br></div>
<br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Doug Newcomb</div><div>USFWS</div><div>Raleigh, NC</div><div>919-856-4520 ext. 14 <a href="mailto:doug_newcomb@fws.gov" target="_blank">doug_newcomb@fws.gov</a></div>
<div>---------------------------------------------------------------------------------------------------------</div><div>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.</div>
</div>