Welcome aboard! We are happy you are here and wish you good net-raft!
// we want to get all records with SMILE happy and Field Node and Id 1003
//Table_1
//id SMILE
//1003 HAPPY
//1001 HAPPY
//1002 SAD
//1003 HAPPY
//1001 HAPPY
//1003 HAPPY
//Table_2
//id Field
//1003 Node
//1001 Java
//1002 PHP
//1006 Node
//1001 C
//1005 Node
select * from Table_1 T1 left join Table_2 T2 on T1.ID = T2.id and T2.Field = 'NODE' where T2.Field is not null and T1.SMILE = 'HAPPY' and T1.id = 1003
// this condition is very important "T2.Field is not null"
The most helpful SQL solutions
how to execute select into using sql ?SQL Click to see more ... 620 53