title: How to LEFT JOIN two external JSON url
body: <p>I'm trying to accomplish below result using external JSON. I searched on google and stackverflow and i couldn't find any answer. Can anyone help me on this? Thank you in advance.</p>
  
  <pre><code>people = 
  [{id: 1, name: "Tom", carid: 1},
  {id: 2, name: "Bob", carid: 1},
  {id: 3, name: "Sir Benjamin Rogan-Josh IV", carid: 2}];
  
  cars=
  [{id: 1, name: "Ford Fiesta", color: "blue"},
  {id: 2, name: "Ferrari", color: "red"},
  {id: 3, name: "Rover 25", color: "Sunset Melting Yellow with hints of yellow"}];
  
  var res = alasql('SELECT people.name AS person_name, cars.name, cars.color \
      FROM ? people LEFT JOIN ? cars ON people.carid = cars.id',[people, cars]);
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>[{"person_name":"Tom","name":"Ford Fiesta","color":"blue"},{"person_name":"Bob","name":"Ford Fiesta","color":"blue"},{"person_name":"Sir Benjamin Rogan-Josh IV","name":"Ferrari","color":"red"}]
  </code></pre>
  
  <hr>
  
  <p><strong>This is my code to access external JSON:</strong></p>
  
  <p>people.json</p>
  
  <pre><code>[{id: 1, name: "Tom", carid: 1},{id: 2, name: "Bob", carid: 1}, {id: 3, name: "Sir Benjamin Rogan-Josh IV", carid: 2}]
  </code></pre>
  
  <p>cars.json</p>
  
  <pre><code>[{id: 1, name: "Ford Fiesta", color: "blue"},{id: 2, name: "Ferrari", color: "red"},{id: 3, name: "Rover 25", color: "Sunset Melting Yellow with hints of yellow"}]
  </code></pre>
  
  <p>JS Code</p>
  
  <pre><code>$(document).ready(function() { 
           $.getJSON('http://example.com/people.json', function(data) { 
                      people = JSON.parse(data);
                  }); 
  
           $.getJSON('http://example.com/cars.json', function(data) { 
                      cars = JSON.parse(data);
                  }); 
  
  
          var res = alasql('SELECT people.name AS person_name, cars.name, cars.color \
          FROM ? people LEFT JOIN ? cars ON people.carid = cars.id',[people, cars]);
  
          document.getElementById('id01').textContent = JSON.stringify(res);
  }):
  </code></pre>
  
  <p>This is the error I'm getting in the console</p>
  
  <pre><code>Uncaught SyntaxError: Unexpected token o in JSON at position 1
  at JSON.parse (&lt;anonymous&gt;)
  at Object.success (list.html:26)
  at c (jquery.min.js:2)
  at Object.fireWith [as resolveWith] (jquery.min.js:2)
  at l (jquery.min.js:2)
  at XMLHttpRequest.&lt;anonymous&gt; (jquery.min.js:2)
  </code></pre>