Re: [SQL] Seeking for the fore-part of the key

2009-01-11 Thread Andreas Kretschmer
Havasvölgyi Ottó schrieb: > Hi, > > Let's assume I have a table (called tbl) with a column 'name' and an index on > it. > How to optimally find records whose name column begins with - say - "Pre"? > I know it can be done with LIKE (WHERE name LIKE 'Pre%'), but will this use > the > index mentio

[SQL] Seeking for the fore-part of the key

2009-01-11 Thread Havasvölgyi Ottó
Hi, Let's assume I have a table (called tbl) with a column 'name' and an index on it. How to optimally find records whose name column begins with - say - "Pre"? I know it can be done with LIKE (WHERE name LIKE 'Pre%'), but will this use the index mentioned above to optimize the search? Thanks, Ot