BUG - Error retrieving data when table has uniqe index

[expired user #10211]'s profile image [expired user #10211] posted 8 years ago in HeidiSQL portable Permalink
CREATE TABLE `companyschedulegroups` (
    `ID` INT(11) NOT NULL AUTO_INCREMENT,
    `CompanyID` INT(11) NOT NULL,
    `ScheduleGroupID` INT(11) NOT NULL,
    `DateCreated` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `DateLastUpdated` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (`ID`),
    UNIQUE INDEX `CompanyID` (`CompanyID`, `ScheduleGroupID`) USING BTREE,
    INDEX `ScheduleGroupID` (`ScheduleGroupID`)```


)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB
AUTO_INCREMENT=22
;


INSERT INTO `companyschedulegroups` ( `CompanyID`, `ScheduleGroupID`, `DateCreated`, `DateLastUpdated`) VALUES ( '2', '11', '2016-10-18 00:00:00', '2016-10-18 00:00:00');
INSERT INTO `companyschedulegroups` ( `CompanyID`, `ScheduleGroupID`, `DateCreated`, `DateLastUpdated`) VALUES ( '1', '1', '2016-10-18 00:00:00', '2016-10-18 00:00:00');

Click the "Data" tab

Please login to leave a reply, or register at first.