Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

left join

You need a first lookup for the values that exist in table1, so make a map using an object:

var maps = {};
for (var i = 0; i < table1.length; i++) {
  maps[table1[i].attr4] = 1;
}

Then you can loop throught the items in table2 and filter them:

var result = [];
for (i = 0; i < table2.length; i++) {
  if (!(table2[i].attr3 in map)) {
    result.push(table2[i]);
  }
}
Source by lms.clarusway.com #
 
PREVIOUS NEXT
Tagged: #left #join
ADD COMMENT
Topic
Name
4+1 =