![]() |
![]()
| ![]() |
![]()
NAMEdb.select - Selects data from attribute table.
KEYWORDSdatabase, attribute table, SQL SYNOPSISdb.select
Flags:
Parameters:
DESCRIPTIONdb.select prints result of selection from database based on SQL statement read from input file or from standard input to standard output. Each individual query has to be written on one single line and different queries have to be written on separate lines. NOTEIf parameters for database connection are already set with db.connect, they are taken as default values and do not need to be specified each time. Output will be displayed to standard output or can be directed to a file (option output). EXAMPLESBasic usagedb.select sql="select * from roads" or
echo "select * from roads" | db.select input=- or
db.select input=file.sql or
cat file.sql | db.select input=- Select all from table roads:
db.select -c driver=odbc database=mydb table=hospitals \ 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 statementscat 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 positionWhen 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 \ SEE ALSOdb.connect, db.describe, db.drivers, db.droptable, db.execute, db.login, db.tables GRASS SQL interface AUTHORSOriginal author unknown (probably CERL)
SOURCE CODEAvailable at: db.select source code (history) Latest change: Wednesday Nov 27 22:53:26 2024 in commit: b90ce69e88409469369ec1edb86fde8ec822af8b Main index | Database index | Topics index | Keywords index | Graphical index | Full index © 2003-2025 GRASS Development Team, GRASS GIS 8.4.1 Reference Manual
|