dbTalk Databases Forums  

How index substring (or part) of fields? - to say from position(3,5)of given field

comp.databases.mysql comp.databases.mysql


Discuss How index substring (or part) of fields? - to say from position(3,5)of given field in the comp.databases.mysql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
mig
 
Posts: n/a

Default How index substring (or part) of fields? - to say from position(3,5)of given field - 10-21-2011 , 03:00 PM






Hello People, I posted this question but it vanished in the net, so
here is it again

My question is probably a basic one, but I didnīt find a clue on INDEX
command.

I have a date field in the form "mm/dd/yyyy" but I want it to be
indexed in the form "yyyy/mm/dd" , so the best solution could be MySql
allow to redefine parts of current field in tyny pieces and give a
"virtual name" for them, allowing INDEX command to work with those
virtual fields.

So I could create "year = mydate(7,4)" "month = mydate(4,2)" and "day
= mydate(1,2)" and then index year + month + day

I donīt know if MySql allow this redefinition of fields, then next
question is: what is the best way of doing it without duplicating the
field? (with another format)

thanks

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.