[GRASS-user] Re: SQL and GRASS

Gary Nobles garynobles at yahoo.com
Thu Mar 11 03:40:35 EST 2010


Hi Richard,

Thankyou for your help, I have been using:

> d.vect  SiteGrid3 where "SquareNumber<>0 "
> or
> v.db.select map=SiteGrid3 column=square_no where=<>0

however as you see in my example in my initial post I have a second table:

> grass SiteGrid3  (one)            Pottery table (many)
> |cat|SquareNumber|            |SquareNumber|Type|count|
> |1   |1                 |            |1                  |mug |12
> |2   |2                 |            |1                  |mug |14
> |3   |3                 |            |1                  |mug |3
> it continues...

d.vect  SiteGrid3 where "SquareNumber<>0 " is great for table1 (left) but I
want to query a non spatial table, the pottery table. So I want to display
all squares where Pottery.Type ='mug' 

and also:

display: select SiteGrid3.SquareNumber, Pottery.SUM(count) from SiteGrid3,
Pottery

I may need an inner join so like this

select SiteGrid3.SquareNumber, Pottery.SUM(count) 
from SiteGrid3, Pottery
Inner JOIN SiteGrid3
ON Pottery.SquareNumber=siteGrid3.SquareNumber
where (possible where statement)

so displaying data based on a complex sql statement

I hope this clarifies my problem

Thanks again

Gary




-- 
View this message in context: http://n2.nabble.com/SQL-and-GRASS-tp4690410p4714753.html
Sent from the Grass - Users mailing list archive at Nabble.com.


More information about the grass-user mailing list