convert() or cast() in valentina

Ruslan Zasukhin ruslan_zasukhin at valentina-db.com
Thu Jan 19 01:36:42 CST 2012


On 1/18/12 11:43 AM, "Giacomo Vernoni" <giacomo at way-out.it> wrote:

Hi Giacomo,

Yet may be more simple and effective way to use
    Table Methods.

* So you have f1 as string or VarChar

* You make m1 of type Long  with method text just  f1
    now SELECT m1  will return you Integer value

And 

    SELECT m1
    FROM T
    WHERE m1 = 10

Will find you EXACT 10
 

Also method you can make indexed -- will be faster searches,
But more disk and slower a little updates.


> Update:
> On Windows, the RegEx pattern doesn't work, but changing the "$" with "\Z"
> fixes it.
> On Mac it works as expected in both ways.
> 
> So the query should be:
> 
> SELECT * FROM images WHERE img_name REGEX '^[^1-9]*10[^0-9]\Z*'
> 
> 
> 
> Giacomo
> 
> 
> On 17 gen 2012, at 11:29, Giacomo Vernoni wrote:
> 
>> Just for the records, the solution to my problem is:
>> 
>> SELECT * FROM images WHERE img_name REGEX '^[^1-9]*10[^0-9]$*'
>> 
>> where "10" is the number to look for in the img_name field.
>> 
>> This query only finds names that contain the number 10 in the text (so
>> "PIC_210_OK.jpg" will NOT be included in the results).
>> 
>> 
>> For google: valentina convert string to number, valentina search exact number
>> in string.

-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list