Hi all.

How to  build index with some function like year() instead of use the whole
column type date.
because I don't need to use the whole lenght (10 bytes) for index but I want
to tuo use only year (first 4 bytes) for index key when I try

ALTER TABLE xxx ADD INDEX yyy (year(BDATE)) ----> error syntax error

ALTER TABLE xxx ADD INDEX yyy (BDATE(4)) ----> error the used key part isn't
string

ALTER TABLE xxx ADD INDEX yyy (BDATE) ----> OK but I don't want this

Thanks.

Kittiphum Worachat,M.T.
www.hatyailab.com




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to