{"action":"opened","issue":{"url":"https://api.github.com/repos/agershun/alasql/issues/104","labels_url":"https://api.github.com/repos/agershun/alasql/issues/104/labels{/name}","comments_url":"https://api.github.com/repos/agershun/alasql/issues/104/comments","events_url":"https://api.github.com/repos/agershun/alasql/issues/104/events","html_url":"https://github.com/agershun/alasql/issues/104","id":64233294,"number":104,"title":"LEAST and GREATEST : TypeError: Object #<Object> has no method 'join'","user":{"login":"gregaubert","id":1725611,"avatar_url":"https://avatars.githubusercontent.com/u/1725611?v=3","gravatar_id":"","url":"https://api.github.com/users/gregaubert","html_url":"https://github.com/gregaubert","followers_url":"https://api.github.com/users/gregaubert/followers","following_url":"https://api.github.com/users/gregaubert/following{/other_user}","gists_url":"https://api.github.com/users/gregaubert/gists{/gist_id}","starred_url":"https://api.github.com/users/gregaubert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregaubert/subscriptions","organizations_url":"https://api.github.com/users/gregaubert/orgs","repos_url":"https://api.github.com/users/gregaubert/repos","events_url":"https://api.github.com/users/gregaubert/events{/privacy}","received_events_url":"https://api.github.com/users/gregaubert/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-25T10:05:06Z","updated_at":"2015-03-25T10:05:06Z","closed_at":null,"body":"When trying to use the __GREATEST__ or __LEAST__ functions with this exemple :\r\n\r\n```javascript\r\nvar alasql = require('alasql');\r\nvar tab = [{a: 1, b:4}, {a:5, b:3}];\r\nalasql('SELECT GREATEST(a, b) as test FROM ?', tab);\r\n```\r\nWe get the error _<Object> has no method 'join' _ because we try to use join on the [arguments](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments) object, and it's not real array, so it got no method __join__.\r\n\r\nIt is possible to solve it by calling the __join__ method like this : \r\n\r\n```javascript\r\nArray.prototype.join.call(arguments, ',')\r\n```\r\n\r\nBut if I update alasql with this fix, then I get __NaN__ results instead of the numbers : \r\n\r\n```javascript\r\n alasql('SELECT GREATEST(a, b) as test FROM ?', a); \r\n// result : [ { test: NaN }, { test: NaN } ]\r\n```\r\n\r\nAnd the result of the __join__ method called on the arguments in the __GREATEST__ method gives this : \r\n```javascript\r\nconsole.log(Array.prototype.join.call(arguments, ','));\r\n// result : p['default']['a'],p['default']['b']\r\n```\r\nIs this correct ? Or could the problem come from that ?"}}