[GRASS-user] SQL query

Hamish hamish_b at yahoo.com
Fri Jan 8 18:15:06 EST 2010

Hamish wrote:
> > this works:
> > 
> > db.select sql="SELECT length FROM track_001 \
> >          UNION SELECT length FROM track_002 \
> >          UNION SELECT length FROM track_003"
> > 
> > but I have something like 100 maps and the statement
> > would get too huge.

Glynn wrote:
> Tough ;)
> SQL doesn't allow you to perform an "implicit union" on
> multiple tables. You need to perform an explicit union,
> and there isn't any kind of "wildcard union" construct;
> IOW, you need an occurence of the SELECT keyword for each
> table.

bummer. oh well, v.patch it is then.
examples found via web searches seemed to indicate that this
was possible.

> If you write the statement as "...LIKE 'track%'" the underscore
> becomes one of the matched characters and not a pattern matching
> wildcard.

nope, no luck.



More information about the grass-user mailing list