sdogoss
10th April 2008, 10:53
I am selecting from a table, and want to check wheter a string begins with "1" or "2"
Can i do that?
zardoz
10th April 2008, 12:33
.....
where :1 in ("1", "2")
wherebind(1, tablefield(1;1))
.....
pellus
11th April 2008, 18:40
I think one can assume that characters 1,2 are next to eachother in any sorting sequence. So with traditional programming:
set.min(comparefieldmin)
set.max(comparefieldmax)
comparefieldmin(1;1) = "1"
comparefieldmax(1;1) = "2"
Evaluation while reading:
field >= comparefieldmin and field <= comparefieldmax
saumya
16th April 2008, 12:57
tmp.string = table.field(1;1)
if tmp.string = "1" or tmp.string = "2"
i think this is the simplest way to achiev this
zardoz
16th April 2008, 13:13
tmp.string = table.field(1;1)
if tmp.string = "1" or tmp.string = "2"
i think this is the simplest way to achiev this
Maybe the simpliest but sure not the more performant way :) .
In this case, the select gets all the records, and after records are used or not.
In my solution, records are chosed or not in the query directly.