[GRASS-user] SQL query

Rich Shepard rshepard at appl-ecosys.com
Fri Jan 8 17:49:16 EST 2010


On Fri, 8 Jan 2010, Hamish wrote:

> which is exactly what I want, a wildcard match track_001, track_002, etc.
> The underscore is along for the ride in this case, but escaping chars is a
> pain in sql and in this case I know it is not likely to harm.
>
> what is the syntax error?

Hamish,

   The sql engine is confused with the underscore followed by the percent
sign. They are two different wildcard characters, as are the regex '?' and
'*'.

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

   I've never tried using both wildcards in the same pattern so I may well be
totally off the solution here.

Rich





More information about the grass-user mailing list