db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Suresh Thalamati <suresh.thalam...@gmail.com>
Subject Re: Regular Expressions
Date Thu, 27 Oct 2005 01:28:02 GMT
duschhaube wrote:
> Hi!
> 
> 
> Is it possible to use regular expressions in a select statement.
> 
> for example select * from test where name="a*b"
> 
> ciao
> 

I don't think you can do that way.  Using  the like operator, one can 
do some pattern matching in Derby.

For Example:
create table t2(name char(30) ) ;
insert into t2 values('ab') ;
insert into t2 values('acccb') ;
insert into t2 values('acccc') ;

To retrive  the name starting with 'a' and ending with 'b'

ij> select * from t2 where names like 'a%b%' ;
NAMES
------------------------------
ab
acccb

you can find more info about like operator in the following doc:
http://db.apache.org/derby/docs/10.1/ref/rrefsqlj23075.html
--



Hope that helps
-suresht


Mime
View raw message