I’m trying to create a table that has two indexes.
sql = _
"CREATE TABLE IF NOT EXISTS `" + DatabaseName + "`.`" + Tablename + "` (" +_
"`JobID` INT NOT NULL, " +_
"`cmd` VARCHAR(512) NOT NULL, " +_
"`State` INT NOT NULL, " +_
"`message` VARCHAR(256) NULL, " +_
"UNIQUE INDEX `JobID_UNIQUE` (`JobID` ASC), " +_
"UNIQUE INDEX `State_UNIQUE` (`State` ASC)) " +_
"ENGINE = InnoDB;"
This came out of MySQLWorkbench.
The problem I believe is that JobID and State are not unique, but I’d still like to have an index into these rows.
(like an ISAM file… you find the first entry and then sequentially go through all results)
What must I do to my my Create Table sql to have indexes but not necessarily unique?