tags:

views:

25

answers:

2

say, I have a table TABLE(col1,col2,col3)

and, I want create a index INDEX(col1=table.col1+table.col2)

A: 

Using InnoDB that's not a problem:

Multiple-Column Indexes

NTulip
A: 
create table myTable
(
pk int(11) not null,
col1 varchar(100),
col2 varchar(100),
col3 varchar(100),
key idx_combo (col1, col2)  <== define index here
) engine=innodb;

or something like that. Documentation is here:

http://dev.mysql.com/doc/refman/5.1/en/create-table.html

davek