{"action":"created","issue":{"url":"https://api.github.com/repos/yajra/laravel-datatables/issues/115","labels_url":"https://api.github.com/repos/yajra/laravel-datatables/issues/115/labels{/name}","comments_url":"https://api.github.com/repos/yajra/laravel-datatables/issues/115/comments","events_url":"https://api.github.com/repos/yajra/laravel-datatables/issues/115/events","html_url":"https://github.com/yajra/laravel-datatables/issues/115","id":94758516,"number":115,"title":"Problem using CASE WHEN on ordering or filtering ","user":{"login":"ptykamikaze","id":5614001,"avatar_url":"https://avatars.githubusercontent.com/u/5614001?v=3","gravatar_id":"","url":"https://api.github.com/users/ptykamikaze","html_url":"https://github.com/ptykamikaze","followers_url":"https://api.github.com/users/ptykamikaze/followers","following_url":"https://api.github.com/users/ptykamikaze/following{/other_user}","gists_url":"https://api.github.com/users/ptykamikaze/gists{/gist_id}","starred_url":"https://api.github.com/users/ptykamikaze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ptykamikaze/subscriptions","organizations_url":"https://api.github.com/users/ptykamikaze/orgs","repos_url":"https://api.github.com/users/ptykamikaze/repos","events_url":"https://api.github.com/users/ptykamikaze/events{/privacy}","received_events_url":"https://api.github.com/users/ptykamikaze/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-13T16:17:53Z","updated_at":"2015-07-14T06:06:31Z","closed_at":null,"body":"I have the a query that returns a (case when) column.. How can I override the column name with the (case when) definition because it is throwing me errors when sorting or filtering by the (case when) column"},"comment":{"url":"https://api.github.com/repos/yajra/laravel-datatables/issues/comments/121140115","html_url":"https://github.com/yajra/laravel-datatables/issues/115#issuecomment-121140115","issue_url":"https://api.github.com/repos/yajra/laravel-datatables/issues/115","id":121140115,"user":{"login":"yajra","id":2687997,"avatar_url":"https://avatars.githubusercontent.com/u/2687997?v=3","gravatar_id":"","url":"https://api.github.com/users/yajra","html_url":"https://github.com/yajra","followers_url":"https://api.github.com/users/yajra/followers","following_url":"https://api.github.com/users/yajra/following{/other_user}","gists_url":"https://api.github.com/users/yajra/gists{/gist_id}","starred_url":"https://api.github.com/users/yajra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yajra/subscriptions","organizations_url":"https://api.github.com/users/yajra/orgs","repos_url":"https://api.github.com/users/yajra/repos","events_url":"https://api.github.com/users/yajra/events{/privacy}","received_events_url":"https://api.github.com/users/yajra/received_events","type":"User","site_admin":false},"created_at":"2015-07-14T06:06:31Z","updated_at":"2015-07-14T06:06:31Z","body":"@ptykamikaze, I think what you need to do is just use the alias on your js name definition like `{ data: 'alias', name: 'alias' }`. On mysql, ordering using alias is allowed. Not sure though on other DB.\r\n\r\nFor filtering, you will still need to use `filterColumn` since the `alias` column does not exists. "}}