{"action":"created","issue":{"url":"https://api.github.com/repos/agershun/alasql/issues/79","labels_url":"https://api.github.com/repos/agershun/alasql/issues/79/labels{/name}","comments_url":"https://api.github.com/repos/agershun/alasql/issues/79/comments","events_url":"https://api.github.com/repos/agershun/alasql/issues/79/events","html_url":"https://github.com/agershun/alasql/issues/79","id":60129996,"number":79,"title":"GROUP BY returns 1 invalid result if no rows meet condition ","user":{"login":"silverhawk184","id":840411,"avatar_url":"https://avatars.githubusercontent.com/u/840411?v=3","gravatar_id":"","url":"https://api.github.com/users/silverhawk184","html_url":"https://github.com/silverhawk184","followers_url":"https://api.github.com/users/silverhawk184/followers","following_url":"https://api.github.com/users/silverhawk184/following{/other_user}","gists_url":"https://api.github.com/users/silverhawk184/gists{/gist_id}","starred_url":"https://api.github.com/users/silverhawk184/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silverhawk184/subscriptions","organizations_url":"https://api.github.com/users/silverhawk184/orgs","repos_url":"https://api.github.com/users/silverhawk184/repos","events_url":"https://api.github.com/users/silverhawk184/events{/privacy}","received_events_url":"https://api.github.com/users/silverhawk184/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/agershun/alasql/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"agershun","id":643040,"avatar_url":"https://avatars.githubusercontent.com/u/643040?v=3","gravatar_id":"","url":"https://api.github.com/users/agershun","html_url":"https://github.com/agershun","followers_url":"https://api.github.com/users/agershun/followers","following_url":"https://api.github.com/users/agershun/following{/other_user}","gists_url":"https://api.github.com/users/agershun/gists{/gist_id}","starred_url":"https://api.github.com/users/agershun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agershun/subscriptions","organizations_url":"https://api.github.com/users/agershun/orgs","repos_url":"https://api.github.com/users/agershun/repos","events_url":"https://api.github.com/users/agershun/events{/privacy}","received_events_url":"https://api.github.com/users/agershun/received_events","type":"User","site_admin":false},"milestone":null,"comments":7,"created_at":"2015-03-06T17:09:22Z","updated_at":"2015-03-24T13:22:07Z","closed_at":null,"body":"If there is a query that has no results, but contains a GROUP BY, it returns one result regardless, with the data of \"undefined\"\r\n\r\n>console.log(alasql('SELECT Name FROM ? WHERE 1=0 GROUP BY Name',[[{Name:'test'}]]));\r\n>returns: [{Name: 'undefined'}] but should be []"},"comment":{"url":"https://api.github.com/repos/agershun/alasql/issues/comments/85492760","html_url":"https://github.com/agershun/alasql/issues/79#issuecomment-85492760","issue_url":"https://api.github.com/repos/agershun/alasql/issues/79","id":85492760,"user":{"login":"agershun","id":643040,"avatar_url":"https://avatars.githubusercontent.com/u/643040?v=3","gravatar_id":"","url":"https://api.github.com/users/agershun","html_url":"https://github.com/agershun","followers_url":"https://api.github.com/users/agershun/followers","following_url":"https://api.github.com/users/agershun/following{/other_user}","gists_url":"https://api.github.com/users/agershun/gists{/gist_id}","starred_url":"https://api.github.com/users/agershun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agershun/subscriptions","organizations_url":"https://api.github.com/users/agershun/orgs","repos_url":"https://api.github.com/users/agershun/repos","events_url":"https://api.github.com/users/agershun/events{/privacy}","received_events_url":"https://api.github.com/users/agershun/received_events","type":"User","site_admin":false},"created_at":"2015-03-24T13:22:07Z","updated_at":"2015-03-24T13:22:07Z","body":"**Is there a way you can test if the fields are requested naked, to automatically apply the FROM() function when used in a GROUP BY?**\r\n\r\nI think, that the standard SQL reaction is to throw a error like \"column is not found\". I think, Alasql can check this, but only for SELECT with GROUP BY clause. Plus, it is hard to recognize these \"naked\" columns in expressions, like:\r\n```sql\r\n    SELECT mycol+1 FROM mytable GROUP BY othercol\r\n```"}}