search
  • Sign In
  • Sign Up
Password reset successful

Follow the proiects vou are interested in andi aet the latestnews about them taster

0 answers
Q&A MySQL 'NOT IN” query 3 tables
MySQL 'NOT IN” query 3 tables
P粉574695215 2026-01-01 11:01:26 Views 92

0

I have 3 tables course, grade and evaluation. I want comparing two tables grade and evaluation . if the data in the table grade does not exist in the table evaluation , then the data will appear (output)

table and output

"   select Grade.ID_Courses,Course.ID_Courses,Grade.NAME, 
    Course.NAME, Grade.ID_Courses,
    Evaluation.NAME,
    Evaluation.Year,    
    Grade.Year
    from Grade, Course, Evaluation
    WHERE 
    Grade.ID_Courses=Course.ID_Courses AND 
    Grade.NAME=JOHN and 
    Grade.Year=1 and 
    Evaluation.NAME=GRADE.NAME and
    Grade.ID_Courses NOT IN (SELECT ID_Courses FROM Evaluation where NAME=JOHN and Year=1 )
    GROUP BY Grade.ID_Courses"

the problem is when the name john is not in the table evaluation then there is no output comes out .

Your Answer
submit

0 answers

Popular tool

vc9-vc14 (32+64 bit) runtime library collection (link below)

vc9-vc14 (32+64 bit) runtime library collection (link below)

Download the collection of runtime libraries required for phpStudy installation

VC9 32-bit

VC9 32-bit

VC9 32-bit phpstudy integrated installation environment runtime library

PHP programmer toolbox full version

PHP programmer toolbox full version

Programmer Toolbox v1.0 PHP Integrated Environment

VC11 32-bit

VC11 32-bit

VC11 32-bit phpstudy integrated installation environment runtime library

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use