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 |