DESCRIPTION

SQL support for GRASS.

Supported is a limited set of SQL functions and operators.

FUNCTIONS

  ALTER TABLE table ADD [COLUMN] columndef
  CREATE TABLE table ( columndefs )
  DROP TABLE table
  SELECT columns FROM table
  SELECT columns FROM table WHERE condition
  DELETE FROM table
  DELETE FROM table WHERE condition
  INSERT INTO table values
  INSERT INTO table ( columns ) values
  UPDATE table SET assignments
  UPDATE table SET assignments WHERE condition

OPERATORS

  "="  : equal
  "<"  : smaller than
  "<=" : smaller/equal than
  ">"  : larger than
  ">=" : larger/equal than
  "<>" : not equal
  "~"  : Substring matching

NOTES

EXAMPLES

Display all vector points except for LAMAR valley and extensive trapping:
 d.vect trapping_sites_points fcol=black icon=basic/diamond col=white size=13 \
    where="valley <> 'LAMAR' OR (valley = 'LAMAR' AND description = 'extensive trapping')"

Select all attributes from table where str1 column values are not 'No Name':

 echo "SELECT * FROM archsites WHERE str1 <> 'No Name'" | db.select

SEE ALSO

db.execute, db.select, db.tables, d.vect
SQL reference links

Last changed: $Date: 2005/05/10 09:58:07 $



Help Index