Rails 4 how to find the maximum length of a string column -


to find maximum length of string column in sql is:

select max(length(<column>)) <table> 

can show how same in rails 4 activerecord or squeel?

you can use model.pluck("max(length(column))"), won't load memory.


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -