{"action":"created","issue":{"url":"https://api.github.com/repos/agershun/alasql/issues/547","labels_url":"https://api.github.com/repos/agershun/alasql/issues/547/labels{/name}","comments_url":"https://api.github.com/repos/agershun/alasql/issues/547/comments","events_url":"https://api.github.com/repos/agershun/alasql/issues/547/events","html_url":"https://github.com/agershun/alasql/issues/547","id":127223642,"number":547,"title":"JOIN should return fields from both tables","user":{"login":"filipkis","id":254631,"avatar_url":"https://avatars.githubusercontent.com/u/254631?v=3","gravatar_id":"","url":"https://api.github.com/users/filipkis","html_url":"https://github.com/filipkis","followers_url":"https://api.github.com/users/filipkis/followers","following_url":"https://api.github.com/users/filipkis/following{/other_user}","gists_url":"https://api.github.com/users/filipkis/gists{/gist_id}","starred_url":"https://api.github.com/users/filipkis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filipkis/subscriptions","organizations_url":"https://api.github.com/users/filipkis/orgs","repos_url":"https://api.github.com/users/filipkis/repos","events_url":"https://api.github.com/users/filipkis/events{/privacy}","received_events_url":"https://api.github.com/users/filipkis/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/agershun/alasql/labels/Bug","name":"Bug","color":"fc2929"},{"url":"https://api.github.com/repos/agershun/alasql/labels/Enhancement","name":"Enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-18T13:11:33Z","updated_at":"2016-01-18T13:45:26Z","closed_at":null,"body":"The JOIN should normally return values from both rows, even if the columns (properties) have the same name. However, here JOIN returns just one version (in this case the second) of the columns with same name (and correctly includes other, non-duplicated columns from the first 'table').\r\n\r\n```javascript\r\nvar data = [{ dep: 'A', qt: 10, price: 5, extra: 1}];\r\n\r\nvar data2 = [{ dep: 'B', qt: 2, price: 5}];\r\n\r\nvar res = alasql('SELECT * FROM ? as a JOIN ? as b',[data,data2]);\r\n```\r\nresults in\r\n```javascript\r\n[{\"dep\":\"B\",\"qt\":2,\"price\":5,\"extra\":1}]\r\n```\r\n\r\nNow I understand that JSON objects can't have two properties with the same name, but shouldn't there be a way of getting both results. For instance, somehow using the \"as\" alias and returning something like:\r\n\r\n```javascript\r\n[{\"a\":{\"dep\":\"A\",\"qt\":10,\"price\":5,\"extra\":1},\"b\":{\"dep\":\"B\",\"q\"t:2,\"price\":5}}]\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/agershun/alasql/issues/comments/172530375","html_url":"https://github.com/agershun/alasql/issues/547#issuecomment-172530375","issue_url":"https://api.github.com/repos/agershun/alasql/issues/547","id":172530375,"user":{"login":"filipkis","id":254631,"avatar_url":"https://avatars.githubusercontent.com/u/254631?v=3","gravatar_id":"","url":"https://api.github.com/users/filipkis","html_url":"https://github.com/filipkis","followers_url":"https://api.github.com/users/filipkis/followers","following_url":"https://api.github.com/users/filipkis/following{/other_user}","gists_url":"https://api.github.com/users/filipkis/gists{/gist_id}","starred_url":"https://api.github.com/users/filipkis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filipkis/subscriptions","organizations_url":"https://api.github.com/users/filipkis/orgs","repos_url":"https://api.github.com/users/filipkis/repos","events_url":"https://api.github.com/users/filipkis/events{/privacy}","received_events_url":"https://api.github.com/users/filipkis/received_events","type":"User","site_admin":false},"created_at":"2016-01-18T13:45:26Z","updated_at":"2016-01-18T13:45:26Z","body":"In my opinion, first option is actually quite good IMHO. It returns results in JSON format that's easier to navigate and process in natural JavaScript way.\r\n\r\nFor `table1.a` I don't see any benefit. Specially because if `a` it self would be an object (e.g. [{ \"table1.a\": { b: 2 }, ...], you wouldn't be able to do `res[\"table1.a.b\"]` and instead would need `res[\"table1.a\"].b` and that would mean mixing concepts.\r\n\r\nDoes AlaSQL already support setting of \"special options\"? If so, what is the example of such options? How are they set?\r\n\r\n"}}