/ Published in: PHP
URL: http://derekallard.com/blog/post/mysql-natural-sort-order-by-on-non-numeric-field-type/
Expand |
Embed | Plain Text
// CodeIgniter snippet //+0 is my sneaky way of tying to force numeric sorting on non-numeric fields $this->db->order_by('dateIssued DESC, invoice_number+0 DESC'); // MySQL snippet // SELECT * FROM SampleData ORDER BY data_char+0;
You need to login to post a comment.
