Hi
El 05/08/10 13:25, vicenrico escribió:
> How can this sentence work in h2 database?
>
> SELECT .. WHERE Name LIKE '[aeiou]%'
>
> I want to show all customers beginning their names with a vowel.
> In real SQL i can do that, but not with h2database.
In "REAL" or standard SQL the LIKE predicate don't support regular expressions
as you try to use. In SQL99 a new "SIMILAR" predicate seems to support regex
but I don't know any dbm that has it implemented.
Anyway you can use an UDF to do that .
regards,
Dario
<ISO SQL92>
X3H2-92-154/DBL CBR-002
4.2 Character strings
4.2.2.2 Other operators involving character strings
<length expression> returns the length of a given character string,
as an integer, in characters, octets, or bits according to the
choice of function.
<position expression> determines the first position, if any, at
which one string, S1, occurs within another, S2. If S1 is of length
zero, then it occurs at position 1 for any value of S2. If S1 does
not occur in S2, then zero is returned.
<like predicate> uses the triadic operator LIKE (or the inverse,
NOT LIKE), operating on three character strings and returning
a Boolean. LIKE determines whether or not a character string
"matches" a given "pattern" (also a character string). The char-
acters '%' (percent) and '_' (underscore) have special meaning when
they occur in the pattern. The optional third argument is a charac-
ter string containing exactly one character, known as the "escape
character", for use when a percent or underscore is required in the
pattern without its special meaning.
</ISO SQL92>
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/h2-database?hl=en.