{"action":"created","issue":{"url":"https://api.github.com/repos/go-gorp/gorp/issues/260","labels_url":"https://api.github.com/repos/go-gorp/gorp/issues/260/labels{/name}","comments_url":"https://api.github.com/repos/go-gorp/gorp/issues/260/comments","events_url":"https://api.github.com/repos/go-gorp/gorp/issues/260/events","html_url":"https://github.com/go-gorp/gorp/issues/260","id":87393352,"number":260,"title":"ORDER ","user":{"login":"TheInsideMan","id":3842823,"avatar_url":"https://avatars.githubusercontent.com/u/3842823?v=3","gravatar_id":"","url":"https://api.github.com/users/TheInsideMan","html_url":"https://github.com/TheInsideMan","followers_url":"https://api.github.com/users/TheInsideMan/followers","following_url":"https://api.github.com/users/TheInsideMan/following{/other_user}","gists_url":"https://api.github.com/users/TheInsideMan/gists{/gist_id}","starred_url":"https://api.github.com/users/TheInsideMan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheInsideMan/subscriptions","organizations_url":"https://api.github.com/users/TheInsideMan/orgs","repos_url":"https://api.github.com/users/TheInsideMan/repos","events_url":"https://api.github.com/users/TheInsideMan/events{/privacy}","received_events_url":"https://api.github.com/users/TheInsideMan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/go-gorp/gorp/labels/question","name":"question","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-11T15:55:00Z","updated_at":"2015-06-12T08:39:41Z","closed_at":null,"body":"The query runs without any errors but its not ordering as required. Tried everything I can think of, really scratching my head with this one. \r\n\r\n```\r\noffset := views.ParseUintOrDefault(c.Request.URL.Query().Get(\"offset\"), 0)\r\nlimit := views.ParseUintOrDefault(c.Request.URL.Query().Get(\"limit\"), uint64(viper.GetInt(\"api.limit\")))\r\norder_by = \"ASC\"\r\nsort_by := c.Request.URL.Query().Get(\"sort_by\")\r\norder := \"Apps.\" + sort_by + \" \" + order_by\r\n\r\n_, err := dbmap.Select(&response.AppsData,\r\n\t\t\t\"SELECT Apps.*, GROUP_CONCAT(DISTINCT IFNULL(AppCategoryMatches.category_id,'-1') SEPARATOR ',') as temp,   GROUP_CONCAT(DISTINCT IFNULL(AppCategories.category_name,'-1') SEPARATOR ',') as tmp_name FROM Apps LEFT JOIN AppCategoryMatches ON AppCategoryMatches.app_id=Apps.id LEFT JOIN AppCategories ON (AppCategoryMatches.`category_id` = AppCategories.id) GROUP BY Apps.id ORDER BY ? LIMIT ? OFFSET ? ;\", string(order), limit, offset)\r\n```"},"comment":{"url":"https://api.github.com/repos/go-gorp/gorp/issues/comments/111415011","html_url":"https://github.com/go-gorp/gorp/issues/260#issuecomment-111415011","issue_url":"https://api.github.com/repos/go-gorp/gorp/issues/260","id":111415011,"user":{"login":"TheInsideMan","id":3842823,"avatar_url":"https://avatars.githubusercontent.com/u/3842823?v=3","gravatar_id":"","url":"https://api.github.com/users/TheInsideMan","html_url":"https://github.com/TheInsideMan","followers_url":"https://api.github.com/users/TheInsideMan/followers","following_url":"https://api.github.com/users/TheInsideMan/following{/other_user}","gists_url":"https://api.github.com/users/TheInsideMan/gists{/gist_id}","starred_url":"https://api.github.com/users/TheInsideMan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheInsideMan/subscriptions","organizations_url":"https://api.github.com/users/TheInsideMan/orgs","repos_url":"https://api.github.com/users/TheInsideMan/repos","events_url":"https://api.github.com/users/TheInsideMan/events{/privacy}","received_events_url":"https://api.github.com/users/TheInsideMan/received_events","type":"User","site_admin":false},"created_at":"2015-06-12T08:39:41Z","updated_at":"2015-06-12T08:39:41Z","body":"Well thats just it, when I run this query inside Sequel Pro it runs fine, ordering is as expected.... using gorp it runs, without errors but returns results unordered."}}