Subject | Re: String Calc/Index |
---|---|
Author | Adam |
Post date | 2008-08-17T11:19:21Z |
--- In firebird-support@yahoogroups.com, "Alan McDonald" <alan@...> wrote:
local area, but can you assume that any number starting with 04 is a
mobile and any number not starting with 04 is not?
If that assumption is OK,
SELECT ID FROM TABLE WHERE MYCOLUMN STARTING WITH '04'
With an index on TABLE.MYCOLUMN
Adam
>job for
> 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
> comparison. This is fine when I move thru a subset of the values but I'dI may be making assumptions about the phone numbering system in your
> like to grab the number from the entire table efficiently if possible.
local area, but can you assume that any number starting with 04 is a
mobile and any number not starting with 04 is not?
If that assumption is OK,
SELECT ID FROM TABLE WHERE MYCOLUMN STARTING WITH '04'
With an index on TABLE.MYCOLUMN
Adam