On 16 Aug 2011, at 9:58pm, Anantha Prasad wrote: > The data is sorted by Longitude and then by Distance. Whenever there are > repeated values of Distance within a Longitude, I want the Sum and Count to > be added and divided - for example, > Here is the table: > Longitude Distance AvgColz SumColz CountColz > 71.0 10 50.0000 100 2 > 71.0 10 92.8571 2600 28 > 71.0 20 83.8710 5200 62 > 71.0 20 82.6389 11900 144 > 71.0 30 62.0425 2916 47 > 71.0 30 81.7119 9642 118 > 71.0 40 17.8723 840 47 > 71.0 40 49.8868 2644 53 > 71.0 50 8.5814 369 43 > 71.0 60 5.0238 211 42
This is manipulation of data, and the way you want it done is not going to be the way the next programmer is going to want it done. Whatever kind of averaging or interpolation you want done, do it in your programming language, either by pre-scanning your database and replacing what you find, or by writing your own sum and count routines which understand what you want done. Simon. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users