echo "select * from roads" | db.select or cat file.sql | db.select or db.select input=file.sql
Select all from table roads
db.select -c driver=odbc database=mydb table=roads \ input=file.sql output=result.csv
Select some string attribute, exclude others:
echo "SELECT * FROM archsites WHERE str1 <> 'No Name'" | db.select
Select some string attribute with ZERO length:
echo "SELECT * FROM archsites WHERE str1 IS NULL" | db.select
Select coordinates from PostGIS table:
echo "SELECT x(geo),y(geo) FROM localizzazione" | db.select
Count number of cases falling into same position:
When multiple observation have the spatial coordinates, they can still be counted
(if needed, coordinates can be uploaded to the attribute table by v.to.db:
db.select sql="SELECT long,lat,site_id,department,obs,COUNT(long) as count_cases \ FROM diseases GROUP BY long,lat"
Last changed: $Date$