{"action":"created","issue":{"url":"https://api.github.com/repos/hadley/dplyr/issues/1503","labels_url":"https://api.github.com/repos/hadley/dplyr/issues/1503/labels{/name}","comments_url":"https://api.github.com/repos/hadley/dplyr/issues/1503/comments","events_url":"https://api.github.com/repos/hadley/dplyr/issues/1503/events","html_url":"https://github.com/hadley/dplyr/issues/1503","id":114879966,"number":1503,"title":"mutate_tbl.sql doesn't support in-place renaming","user":{"login":"jarodmeng","id":854353,"avatar_url":"https://avatars.githubusercontent.com/u/854353?v=3","gravatar_id":"","url":"https://api.github.com/users/jarodmeng","html_url":"https://github.com/jarodmeng","followers_url":"https://api.github.com/users/jarodmeng/followers","following_url":"https://api.github.com/users/jarodmeng/following{/other_user}","gists_url":"https://api.github.com/users/jarodmeng/gists{/gist_id}","starred_url":"https://api.github.com/users/jarodmeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jarodmeng/subscriptions","organizations_url":"https://api.github.com/users/jarodmeng/orgs","repos_url":"https://api.github.com/users/jarodmeng/repos","events_url":"https://api.github.com/users/jarodmeng/events{/privacy}","received_events_url":"https://api.github.com/users/jarodmeng/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-11-03T18:28:17Z","updated_at":"2015-11-04T20:28:58Z","closed_at":"2015-11-03T23:19:06Z","body":"mutate_.tbl_sql combines new input with all previous select ([here](https://github.com/hadley/dplyr/blob/dd10ccd543a2bea99573e6622b46d50f657b0c1f/R/tbl-sql.r#L339)). If any input element has the same name as any original column, it will result in duplicated column name error in SQL.\r\n\r\nThis behavior is also different from mutate_.tbl_df."},"comment":{"url":"https://api.github.com/repos/hadley/dplyr/issues/comments/153853204","html_url":"https://github.com/hadley/dplyr/issues/1503#issuecomment-153853204","issue_url":"https://api.github.com/repos/hadley/dplyr/issues/1503","id":153853204,"user":{"login":"jarodmeng","id":854353,"avatar_url":"https://avatars.githubusercontent.com/u/854353?v=3","gravatar_id":"","url":"https://api.github.com/users/jarodmeng","html_url":"https://github.com/jarodmeng","followers_url":"https://api.github.com/users/jarodmeng/followers","following_url":"https://api.github.com/users/jarodmeng/following{/other_user}","gists_url":"https://api.github.com/users/jarodmeng/gists{/gist_id}","starred_url":"https://api.github.com/users/jarodmeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jarodmeng/subscriptions","organizations_url":"https://api.github.com/users/jarodmeng/orgs","repos_url":"https://api.github.com/users/jarodmeng/repos","events_url":"https://api.github.com/users/jarodmeng/events{/privacy}","received_events_url":"https://api.github.com/users/jarodmeng/received_events","type":"User","site_admin":false},"created_at":"2015-11-04T20:28:58Z","updated_at":"2015-11-04T20:28:58Z","body":"@krlmlr I'm not trying to generate a shorter SQL expression, but a working one. The current one is *not* working and I'm not convinced that wrapping a subquery around it would fix the issue. I'm certainly open to ideas on how to fix the problem.\r\n\r\nThe fact that in-place renaming works for data frames, but not databases is exactly the problem I'm trying to find a solution here."}}