other versions
- jessie 6.4.4-1
- stretch 7.2.0-2
- testing 7.6.0-1
- unstable 7.6.0-1
- experimental 7.6.1-1~exp1
| db.select(1grass) | Grass User's Manual | db.select(1grass) |
NAME¶
db.select - Selects data from attribute table (performs SQL query statement(s)).KEYWORDS¶
database, attribute table, SQLSYNOPSIS¶
db.selectFlags:¶
- -c
-
Do not include column names in output
- -d
-
Describe query only (don't run it)
- -v
-
Vertical output (instead of horizontal)
- -t
-
Only test query, do not execute
- --verbose
-
Verbose module output
- --quiet
-
Quiet module output
Parameters:¶
- table=name
-
Table name
- database=name
-
Database nameDefault: $GISDBASE/$LOCATION_NAME/$MAPSET/dbf/
- driver=name
-
Driver nameOptions: pg,dbf,ogr,odbc,mysql,sqliteDefault: dbf
- sql=string
-
SQL select statementFor example: 'select * from rybniky where kapri = 'hodne'
- input=name
-
Name of file with sql statement
- fs=character
-
Field separatorOutput field separatorDefault: |
- vs=character
-
Field separatorOutput vertical record separator
- nv=string
-
Null value indicator
- output=name
-
Name for output file (if omitted or "-" output to stdout)
DESCRIPTION¶
db.select prints result of selection from database based on SQL statement read from input file or from standard input to standard output.NOTE¶
If parameters for database connection are already set with db.connect, they are taken as default values and do not need to be spcified each time. Output will be displayed to stdout or can be directed to a file.EXAMPLES¶
cat file.sql | db.select
db.select input=file.sql
input=file.sql output=result.csv
FROM diseases GROUP BY long,lat"
SEE ALSO¶
GRASS SQL interface,AUTHOR¶
Unknown| GRASS 6.4.4 |