1 Reply Latest reply on Oct 30, 2013 3:05 AM by Hein Boshoff

    Rhom: Sorting upon a column not considering the case (lower/upper)

      I have been trying to sort the output of select query based upon one column as like this,

       

      users = User.find(:all, :select => ['name'], :order => ["name"], :orderdir => ["ASC"], :conditions => {:deleted => 'false'})


      But this sorts the list based upon the case separately and giving below output,


      Ashis
      Ram
      lucky
      syam


      which should be like this,


      Ashis
      lucky
      Ram
      syam


      So i tried this way and got the output,


      users = User.find_by_sql("select name from user where deleted = 'false' order by lower(name) ASC")


      I'm just wondering the way to achieve this using .find. Not sure how to do so ?