Query Builder order by lenght |
Hi ,i have a field on db alphanumeric (A01,A20,A110) , to sorting properly i must sort by LENGHT(nome) , nome but if i do this :
Code: $scaffali_model->orderBy('LENGHT(nome) ASC , nome ASC')->findAll();
use SELECT to get the length, then can use the sort
select(' length(nome) as L') orderBy('L asc') |
Welcome Guest, Not a member yet? Register Sign In |