v.db.select(1grass)


NAME

   v.db.select  - Prints vector map attributes.

KEYWORDS

   vector, attribute table, database, SQL

SYNOPSIS

   v.db.select
   v.db.select --help
   v.db.select          [-rcvf]          map=name           [layer=string]
   [columns=name[,name,...]]       [where=sql_query]        [group=string]
   [separator=character]                    [vertical_separator=character]
   [null_value=string]       [file=name]       [--overwrite]      [--help]
   [--verbose]  [--quiet]  [--ui]

   Flags:
   -r
       Print  minimal region extent of selected vector features instead of
       attributes

   -c
       Do not include column names in output

   -v
       Vertical output (instead of horizontal)

   -f
       Exclude attributes not linked to features

   --overwrite
       Allow output files to overwrite existing files

   --help
       Print usage summary

   --verbose
       Verbose module output

   --quiet
       Quiet module output

   --ui
       Force launching GUI dialog

   Parameters:
   map=name [required]
       Name of vector map
       Or data source for direct OGR access

   layer=string
       Layer number or name
       Vector features can have category values in different layers.  This
       number  determines  which  layer  to use. When used with direct OGR
       access this is the layer name.
       Default: 1

   columns=name[,name,...]
       Name of attribute column(s)

   where=sql_query
       WHERE conditions of SQL statement without 'where' keyword
       Example: income < 1000 and inhab >= 10000

   group=string
       GROUP BY conditions of SQL statement without 'group by' keyword

   separator=character
       Field separator
       Special characters: pipe, comma, space, tab, newline
       Default: pipe

   vertical_separator=character
       Output vertical record separator
       Special characters: pipe, comma, space, tab, newline

   null_value=string
       String representing NULL value

   file=name
       Name for output file (if omitted or "-" output to stdout)

DESCRIPTION

   v.db.select prints attributes of a vector map from one or several  user
   selected attribute table columns.

EXAMPLES

   All examples are based on the North Carolina sample dataset.

   Select and show entire table
   v.db.select map=roadsmajor
   cat|MAJORRDS_|ROAD_NAME|MULTILANE|PROPYEAR|OBJECTID|SHAPE_LEN
   1|1|NC-50|no|0|1|4825.369405
   2|2|NC-50|no|0|2|14392.589058
   3|3|NC-98|no|0|3|3212.981242
   4|4|NC-50|no|0|4|13391.907552
   ...

   Select and show single column from table
   Note: multiple columns can be specified as comma separated list.
   v.db.select map=roadsmajor column=ROAD_NAME
   NC-50
   NC-50
   NC-98
   NC-50
   NC-98
   ...

   Print region extent of selected vector features
   v.db.select -r map=roadsmajor where="ROAD_NAME = 'NC-98'"
   n=248425.389891
   s=245640.640081
   w=635906.517653
   e=661979.801880

   Select empty vector features (no data entries)
   v.db.select geonames_wake where="ALTERNATEN IS NULL"
   cat|GEONAMEID|NAME|ASCIINAME|ALTERNATEN|FEATURECLA|FEATURECOD|...
   8|4498303|West Raleigh|West Raleigh||P|PPL|US||NC|338759|123|...
   14|4459467|Cary|Cary||P|PPL|US||NC|103945|146|152|America/Iqaluit|...
   31|4452808|Apex|Apex||P|PPL|US||NC|30873|167|134|America/Iqaluit|...
   ...

   Select not empty vector features (no data entries)
   v.db.select geonames_wake where="ALTERNATEN IS NOT NULL"
   cat|GEONAMEID|NAME|ASCIINAME|ALTERNATEN|FEATURECLA|FEATURECOD|...
   9|4487042|Raleigh|Raleigh|Raleigh,...
   31299|4487056|Raleigh-Durham Airport|Raleigh-Durham Airport|...
   ...

   Select features with distinct road names
   v.db.select map=roadsmajor columns=ROAD_NAME group=ROAD_NAME
   ROAD_NAME
   I-40
   I-440
   I-540
   NC-231
   NC-39
   NC-42
   ...
   It is also possible to combine with where option
   v.db.select map=roadsmajor columns=ROAD_NAME,MULTILANE group=ROAD_NAME where='ROAD_NAME is not null'
   ROAD_NAME|MULTILANE
   I-40|yes
   I-440|yes
   I-540|yes
   NC-231|no
   NC-39|no
   NC-42|no
   NC-50|no
   NC-54|no
   NC-55|no
   NC-96|no
   NC-97|no
   NC-98|no
   US-1|
   US-401|no
   US-64|yes
   US-70|yes
   It can also use more columns in group option
   v.db.select map=roadsmajor columns=ROAD_NAME,MULTILANE group=ROAD_NAME,MULTILANE where='ROAD_NAME is not null'
   ROAD_NAME|MULTILANE
   I-40|yes
   I-440|yes
   I-540|yes
   NC-231|no
   NC-39|no
   NC-42|no
   NC-50|no
   NC-54|no
   NC-55|no
   NC-96|no
   NC-97|no
   NC-98|no
   US-1|
   US-1|yes
   US-401|no
   US-401|yes
   US-64|yes
   US-70|yes

SEE ALSO

    db.select

AUTHORS

   Radim Blazek, ITC-Irst, Trento, Italy
   Minimal  region  extent  added  by  Martin  Landa,  FBK-irst  (formerly
   ITC-irst), Trento, Italy (2008/08)
   Group option added by Luca Delucchi, Fondazione  Edmund  Mach,  Trento,
   Italy (2015/12)

   Last changed: $Date: 2016-10-27 23:24:04 +0200 (Thu, 27 Oct 2016) $

SOURCE CODE

   Available at: v.db.select source code (history)

   Main  index  | Vector index | Topics index | Keywords index | Graphical
   index | Full index

    2003-2016 GRASS Development Team, GRASS GIS 7.2.0 Reference Manual





Opportunity


Personal Opportunity - Free software gives you access to billions of dollars of software at no cost. Use this software for your business, personal use or to develop a profitable skill. Access to source code provides access to a level of capabilities/information that companies protect though copyrights. Open source is a core component of the Internet and it is available to you. Leverage the billions of dollars in resources and capabilities to build a career, establish a business or change the world. The potential is endless for those who understand the opportunity.

Business Opportunity - Goldman Sachs, IBM and countless large corporations are leveraging open source to reduce costs, develop products and increase their bottom lines. Learn what these companies know about open source and how open source can give you the advantage.





Free Software


Free Software provides computer programs and capabilities at no cost but more importantly, it provides the freedom to run, edit, contribute to, and share the software. The importance of free software is a matter of access, not price. Software at no cost is a benefit but ownership rights to the software and source code is far more significant.


Free Office Software - The Libre Office suite provides top desktop productivity tools for free. This includes, a word processor, spreadsheet, presentation engine, drawing and flowcharting, database and math applications. Libre Office is available for Linux or Windows.





Free Books


The Free Books Library is a collection of thousands of the most popular public domain books in an online readable format. The collection includes great classical literature and more recent works where the U.S. copyright has expired. These books are yours to read and use without restrictions.


Source Code - Want to change a program or know how it works? Open Source provides the source code for its programs so that anyone can use, modify or learn how to write those programs themselves. Visit the GNU source code repositories to download the source.





Education


Study at Harvard, Stanford or MIT - Open edX provides free online courses from Harvard, MIT, Columbia, UC Berkeley and other top Universities. Hundreds of courses for almost all major subjects and course levels. Open edx also offers some paid courses and selected certifications.


Linux Manual Pages - A man or manual page is a form of software documentation found on Linux/Unix operating systems. Topics covered include computer programs (including library and system calls), formal standards and conventions, and even abstract concepts.