[Gambas-user] Wild cards in filter expressions
Charlie Reinl
Karl.Reinl at ...2345...
Tue Aug 6 21:26:41 CEST 2013
Am Dienstag, den 06.08.2013, 13:56 -0400 schrieb Marty McGlensey:
> Hello,
>
>
>
> I need to write a filter expression for a datasource that includes wildcard
> characters (* or ?). I'd like to filter on this expression name = '*mith'.
> The result should be all records with a name equal to Smith. I'm using MySql
> as the underlying database. The usual wildcards are the * and ?. In MySql I
> have found it to be %.
>
>
>
> Does Gambas support wildcards in filter strings? If so, what are they? Is
> there a work around?
>
>
>
> Thanks,
>
> Marty
Salut Marty,
SQL Wildcards work with LIKE and that has nothing to do with gambas.
your mysql query could be :
Select * from <your Table> Where name like '%mith'
or Select * from <your Table> Where name like '%m%th'
or Select * from <your Table> Where name like '%th'
or Select * from <your Table> Where name like '%t%'
You will always find your Smith too.
or Select * from <your Table> Where name = 'Smith'
--
Amicalement
Charlie
More information about the User
mailing list