Re: SELECT mit NOT EXISTS
Hi Peter,
sorry I exported the wrong tables. Its not the group once its the detail once, so here are the right tables:
CREATE TABLE `person` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`vmSpenderNr` int(10) DEFAULT NULL,
`titel` varchar(250) DEFAULT NULL,
`name` varchar(250) NOT NULL,
`vorname` varchar(250) DEFAULT NULL,
`foto` varchar(250) DEFAULT NULL,
`tag` int(10) DEFAULT NULL,
`monat` int(10) DEFAULT NULL,
`jahr` int(10) DEFAULT NULL,
`zeitstempel` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id_UNIQUE` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=557 DEFAULT CHARSET=utf8
this one is the group table
CREATE TABLE `detail` (
`IDdetail` int(11) NOT NULL AUTO_INCREMENT,
`detail` varchar(250) NOT NULL,
PRIMARY KEY (`IDdetail`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8
this one is the assignment table
CREATE TABLE `detailzuordnung` (
`zuordnungID` int(255) NOT NULL AUTO_INCREMENT,
`person_id` int(255) NOT NULL,
`detail_id` int(255) NOT NULL,
`status` int(11) DEFAULT NULL,
`zeitstempel` int(255) NOT NULL,
PRIMARY KEY (`zuordnungID`),
KEY `connect_person` (`person_id`),
KEY `connect_detail` (`detail_id`),
CONSTRAINT `connect_detail` FOREIGN KEY (`detail_id`) REFERENCES `detail` (`IDdetail`) ON DELETE CASCADE,
CONSTRAINT `connect_person` FOREIGN KEY (`person_id`) REFERENCES `person` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=1280 DEFAULT CHARSET=utf8