|
@@ -85,16 +85,30 @@ and <i>extensive trapping</i> (brackets are superfluous in this
|
|
|
example):
|
|
|
|
|
|
<div class="code"><pre>
|
|
|
-d.vect trapping_sites_points fcol=black icon=basic/diamond col=white size=13 \
|
|
|
- where="valley <> 'LAMAR' OR (valley = 'LAMAR' AND description = 'extensive trapping')"
|
|
|
+g.region vector=schools_wake -p
|
|
|
+d.mon wx0
|
|
|
+d.vect roadsmajor
|
|
|
+
|
|
|
+# all schools
|
|
|
+d.vect schools_wake fcol=black icon=basic/diamond col=white size=13
|
|
|
+
|
|
|
+# numerical selection: show schools with capacity of above 1000 kids:
|
|
|
+d.vect schools_wake fcol=blue icon=basic/diamond col=white size=13 \
|
|
|
+ where="CAPACITYTO > 1000"
|
|
|
+
|
|
|
+# string selection: all schools outside of Raleigh
|
|
|
+# along with higher level schools in Raleigh
|
|
|
+d.vect schools_wake fcol=red icon=basic/diamond col=white size=13 \
|
|
|
+ where="ADDRCITY <> 'Raleigh' OR (ADDRCITY = 'Raleigh' AND GLEVEL = 'H')"
|
|
|
</pre></div>
|
|
|
|
|
|
<p>
|
|
|
-Select all attributes from table where <i>str1</i> column values are not 'No
|
|
|
-Name':
|
|
|
+Select all attributes from table where <i>CORECAPACI</i> column values are
|
|
|
+smaller than 200 (children):
|
|
|
|
|
|
<div class="code"><pre>
|
|
|
-echo "SELECT * FROM archsites WHERE str1 <> 'No Name'" | db.select
|
|
|
+# must be run from the mapset which contains the table
|
|
|
+echo "SELECT * FROM schools_wake WHERE CORECAPACI < 200" | db.select input=-
|
|
|
</pre></div>
|
|
|
<p>
|
|
|
|
|
@@ -102,7 +116,7 @@ echo "SELECT * FROM archsites WHERE str1 <> 'No Name'" | db.select
|
|
|
Example of subquery expressions from a list (not supported for DBF driver):
|
|
|
|
|
|
<div class="code"><pre>
|
|
|
-v.db.select mysites where="id IN ('P04', 'P05')"
|
|
|
+v.db.select schools_wake where="ADDRCITY IN ('Apex', 'Wendell')"
|
|
|
</pre></div>
|
|
|
|
|
|
<h3>Example of pattern matching</h3>
|
|
@@ -110,9 +124,10 @@ v.db.select mysites where="id IN ('P04', 'P05')"
|
|
|
<div class="code"><pre>
|
|
|
# field contains string:
|
|
|
# for DBF driver:
|
|
|
-v.extract rivers out=rivers_noce where="DES LIKE 'NOCE'"
|
|
|
+v.extract schools_wake out=elementary_schools where="NAMELONG LIKE 'ELEM'"
|
|
|
# for SQLite driver:
|
|
|
-v.extract rivers out=rivers_noce where="DES LIKE '%NOCE%'"
|
|
|
+v.extract schools_wake out=rivers_noce where="DES LIKE '%NOCE%'"
|
|
|
+v.extract schools_wake out=elementary_schools where="NAMELONG LIKE '%ELEM%'"
|
|
|
|
|
|
# match exactly number of characters (here: 2), does not work for DBF driver:
|
|
|
v.db.select mysites where="id LIKE 'P__'"
|