Reputation: 13
How can i order by two fields in kohana query builder
Eg:- I have two fields of first name and date
I need to order by in single query selection.
Upvotes: 0
Views: 549
Reputation: 1115
Please read this. As they have mentioned Multiple order_by() methods can be used to add additional sorting capability.For eg. please try as below:
$query = DB::select()->from(`users`)->order_by(`first_name`, `DESC`)->order_by(`date`, `DESC`);
Upvotes: 2