php - how can I create index on the basis of column content first 4 letter? -


how can create index on basis of column content first 4 letter?

for example have table having multiple fields, 1 field having name country, country name in table.

rank    country -------------------------- 1       qatar 2       luxembourg 3       singapore 4       brunei darussalam 5       kuwait 6       norway 7       united arab emirates 8       switzerland 9       united states 10      hong kong sar 

now want indexing on country field. want indexing on first 4 letter of filed data.

this called "prefix" index:

index(country(4)) 

but don't recommend it. there under 300 countries in world; may index full strings.


Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -