Answer the question
In order to leave comments, you need to log in
Why doesn't left join work?
there is a code:
CREATE TABLE NAMES(pk integer PRIMARY KEY, Name text);
CREATE TABLE CITIES(fk integer, Name text);
INSERT INTO NAMES VALUES(1,'Tom');
INSERT INTO NAMES VALUES(2,'Lucy');
INSERT INTO NAMES VALUES(3,'Frank');
INSERT INTO CITIES VALUES(1,'Moscow');
INSERT INTO CITIES VALUES(3,'Saransk');
INSERT INTO CITIES VALUES(4,'Penza');
INSERT INTO CITIES VALUES(1,'Samara');
SELECT * FROM NAMES LEFT JOIN CITIES WHERE pk = fk
1|Tom|1|Moscow
1|Tom|1|Samara
3|Frank|3|Saransk
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question