Home > database > Which logical ability to look at it
Which logical ability to look at it
Time:09-27
Example: there are two table 1. 2 school student (primary school "id" is a student of a foreign key "s_id")
I want to two tables associated query, data for all school and school of corresponding student data
Then a statement
` ` ` Select * The form School sc, student st Where sc. Id=student. S_id ` ` `
In the table and then the problem comes when the school has no corresponding student, school data also can not get
And I hope that the result is: whether school corresponds to the student, the school first full access to the data, if there is a corresponding student, at the same time, access student data
Excuse me everybody have any good ideas?
CodePudding user response:
Where school. Id=student. Sid (+) as the connection with your other conditions change