[GRASS5] Re: intersect sites with polygons?

Christoph Simon ciccio at kiosknet.com.br
Fri Jul 5 06:39:53 EDT 2002


On Fri, 5 Jul 2002 08:47:15 +0200
Radim Blazek <blazek at itc.it> wrote:

> DB file is definition for database connection (time to test grass51).
> Give me example of aggregate function usage.

The classic SQL example for an aggregate functin is:

	select max (val) from tab where ...;

this will return just one row, so it's not going to be typical as an
attribute. OTOH, SQL generally and Postgres in particular allows to
write SQL and C-language based functions, which can do more or less
everything: Someone might have a map associated with one or more
tables and one column for each set of climate data measured. This is
the point, where she could experiment with different algorithms to
predict future values, compare it to already known ones and compute an
index of quality of prediction which would be displayed in the map.

One thing I use pretty frequently, which is not an aggregate function
but which also requires access to the first part are more or less
simple arithmetic operations;

	select inches * 25.4 AS milims from...

Of course, there is still the DISTINCT keyword which can go there and,
last but not least, let's not forget what the R means in RDBMS.

-- 
Christoph Simon
ciccio at kiosknet.com.br
---
^X^C
q
quit
:q
^C
end
x
exit
ZZ
^D
?
help
.



More information about the grass-dev mailing list