db.select sql="select * from roads"
echo "select * from roads" | db.select input=-
db.select input=file.sql
cat file.sql | db.select input=-
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:
db.select sql="SELECT * FROM archsites WHERE str1 <> 'No Name'"
Select some string attribute with ZERO length:
db.select sql="SELECT * FROM archsites WHERE str1 IS NULL"
Select coordinates from PostGIS table:
db.select sql="SELECT x(geo),y(geo) FROM localizzazione"
Execute multiple SQL statements:
cat file.sql SELECT * FROM busstopsall WHERE cat = 1 SELECT cat FROM busstopsall WHERE cat > 4 AND cat < 8 db.select input=file.sql
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"
db.connect, db.describe, db.drivers, db.droptable, db.execute, db.login, db.tables
Last changed: $Date$