[GRASS-SVN] r55675 - grass/trunk/db/db.select
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Apr 9 09:54:13 PDT 2013
Author: neteler
Date: 2013-04-09 09:54:13 -0700 (Tue, 09 Apr 2013)
New Revision: 55675
Modified:
grass/trunk/db/db.select/db.select.html
Log:
db.select: GROUP BY example added
Modified: grass/trunk/db/db.select/db.select.html
===================================================================
--- grass/trunk/db/db.select/db.select.html 2013-04-09 16:52:33 UTC (rev 55674)
+++ grass/trunk/db/db.select/db.select.html 2013-04-09 16:54:13 UTC (rev 55675)
@@ -34,7 +34,8 @@
<p>
Select all from table roads:
<div class="code"><pre>
-db.select -c driver=odbc database=g51test table=roads input=file.sql output=result.csv
+db.select -c driver=odbc database=mydb table=roads \
+ input=file.sql output=result.csv
</pre></div>
<p>
@@ -65,6 +66,16 @@
db.select input=file.sql
</pre></div>
+<p>
+
+<em>Count number of cases falling into same position:</em><br>
+When multiple observation have the spatial coordinates, they can still be counted
+(if needed, coordinates can be uploaded to the attribute table by <em>v.to.db</em>:
+<div class="code"><pre>
+db.select sql="SELECT long,lat,site_id,department,obs,COUNT(long) as count_cases \
+ FROM diseases GROUP BY long,lat"
+</pre></div>
+
<h2>SEE ALSO</h2>
<em>
@@ -72,15 +83,15 @@
</em>
<p>
- <em>
- <a href="db.connect.html">db.connect</a>,
- <a href="db.describe.html">db.describe</a>,
- <a href="db.drivers.html">db.drivers</a>,
- <a href="db.droptable.html">db.droptable</a>,
- <a href="db.execute.html">db.execute</a>,
- <a href="db.login.html">db.login</a>,
- <a href="db.tables.html">db.tables</a>
- </em>
+<em>
+<a href="db.connect.html">db.connect</a>,
+<a href="db.describe.html">db.describe</a>,
+<a href="db.drivers.html">db.drivers</a>,
+<a href="db.droptable.html">db.droptable</a>,
+<a href="db.execute.html">db.execute</a>,
+<a href="db.login.html">db.login</a>,
+<a href="db.tables.html">db.tables</a>
+</em>
<h2>AUTHOR</h2>
More information about the grass-commit
mailing list