mercredi 4 mai 2016

Sqlite join multiple tables issue

Hi everybody hi have this three tables

CREATE TABLE test1 (
   c1 integer,
   primary key (c1)
);
CREATE TABLE test2 (
   c1 integer,
   c2 integer,
   primary key (c2)
);    
CREATE TABLE test3 (
   c2 integer,
   c3 integer,
   primary key (c3)
);

and i've tried this query but returned all the table not the affected row

SELECT test1.c1, test2.c2, test3.c3
FROM test1
LEFT JOIN test2 ON test1.c1=test2.c1 AND test1.c1 = 1
LEFT JOIN test3 ON test2.c2=test3.c2 

Aucun commentaire:

Enregistrer un commentaire