Ich habe einige Tabellen:SQL: Daten aus einer Tabelle, die nicht Wert aus einer anderen Tabelle enthält
CREATE TABLE `entidade_pessoa_avaliacao` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`idEntidade_pessoa` int(10) unsigned NOT NULL,
`idSemana` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `idEscola_Matriculado_idSemana` (`idEntidade_pessoa`,`idSemana`),
KEY `idEscola_Matriculado` (`idEntidade_pessoa`),
KEY `idSemana` (`idSemana`),
CONSTRAINT `FK_smsescola_escola_acao_smsescola_escola_matriculado` FOREIGN KEY (`idEntidade_pessoa`) REFERENCES `entidade_pessoa` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_smsescola_escola_matriculado_avaliacao_smsescola_semana` FOREIGN KEY (`idSemana`) REFERENCES `semana` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=115 DEFAULT CHARSET=utf8;
INSERT INTO `entidade_pessoa_avaliacao` (`id`, `idEntidade_pessoa`, `idSemana`) VALUES
(1, 1, 1),
(2, 2, 1),
(3, 3, 1),
(4, 1, 2),
(5, 2, 2),
(6, 3, 2);
CREATE TABLE `semana` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`nome_curto` varchar(250) NOT NULL,
`inicio` date NOT NULL COMMENT,
`termino` date NOT NULL COMMENT,
`idDimensao` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `idDimensao` (`idDimensao`)
) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8;
INSERT INTO `semana` (`id`, `nome_curto`, `inicio`, `termino`) VALUES
(1, 'Faltas', '2017-10-24', '2017-11-14'),
(2, 'Tarefas','2017-11-07', '2017-11-14'),
(3, 'Participacao','2017-11-07', '2017-11-14');
Ich brauche weicht WEEK, um herauszufinden, ist nicht in der student_avaliation Tabelle basierend auf dem Datum. Was soll ich zum Beispiel tun, um zu wissen, welche Woche wo nicht registriert wurde? Wo ist die Woche? '14/11/2017 '?
Ich weiß, dass ich NOT EXISTS verwenden muss, aber ich weiß nicht, wie es geht.
Kann mir jemand helfen?
Sie etwas posten Möchten Sie versucht haben, oder zumindest der Auswahl ohne die NICHT EXISTEN? – Vinnie
Veröffentlichen Sie die Tabellen und Daten als Text [LESEN SIE DIESE] (http://meta.stackoverflow.com/questions/285551/why-may-i-not-upload-images-of-code-on-so-when-asking) -a-question/285557 # 285557) zu verstehen, warum –
Zeigen Sie uns db Schema, Beispieldaten, aktuelle und erwartete Ausgabe. \t Bitte lesen Sie [** How-to-Frage **] (http://stackoverflow.com/help/how-to-ask) \t \t Und hier ist ein toller Ort, um [** START **] (http://spaghettiba.com/2015/04/24/how-to-post-at-sql-question-on-a-public-forum/) um zu erfahren, wie Sie die Qualität Ihrer Fragen verbessern und bessere Antworten erhalten. \t [** So erstellen Sie ein minimales, vollständiges und überprüfbares Beispiel **] (http://StackOverflow.com/Help/Mcve) –