Home > database >  How to let the where does not exist in the value of the display is NULL
How to let the where does not exist in the value of the display is NULL

Time:09-16

This problem, see a lot of people online expression is not clear, or a lot of people understand is wrong, I'm the examples to describe, and can teach,
Little red to query three students program, xiao Ming and xiao gang, but the name of xiao gang in result table doesn't exist, I want to check the results are shown as:

Little red 80
Xiao Ming 80
Xiao gang NULL
Thank you, could you tell me how to write SQL

CodePudding user response:

Your original data looks like, what is your statements, all the way,

CodePudding user response:

The students left the join result on student. Student id=results. Student id

CodePudding user response:

Use the upstairs
SELECT * FROM the students left the join result on student. Student id=results. Student id
The students here, is the student table, to include inside you need to check out all the students,
  • Related