Subject | String Calc/Index |
---|---|
Author | Alan McDonald |
Post date | 2008-08-17T10:18:34Z |
I have a column containing mobile phone numbers in the following format
04XX XXX XXX
I need to search this table efficiently based on a known number in the
format
04XXXXXXXX
So I need to either create a calculated column or an index which will
provide efficiency in
SELECT ID FROM TABLE WHERE MYCOLUMN='04XXXXXXXX'
Does anyone have any ideas of the best way?
In Delphi I just have a stripspaces and trim function which does the job for
comparison. This is fine when I move thru a subset of the values but I'd
like to grab the number from the entire table efficiently if possible.
regards
Alan McDonald
04XX XXX XXX
I need to search this table efficiently based on a known number in the
format
04XXXXXXXX
So I need to either create a calculated column or an index which will
provide efficiency in
SELECT ID FROM TABLE WHERE MYCOLUMN='04XXXXXXXX'
Does anyone have any ideas of the best way?
In Delphi I just have a stripspaces and trim function which does the job for
comparison. This is fine when I move thru a subset of the values but I'd
like to grab the number from the entire table efficiently if possible.
regards
Alan McDonald