2 Replies Latest reply on Dec 28, 2012 4:50 AM by Mariano Colabraro

    How to retrieve unique values from 2 columns using Ruby?

    Mark Nongkhlaw

      Hi,

       

      I wanted to retrieve unique values from 2 columns in my SQLite table. I tried using code like :

       

      # Get Unique Func.Heads from Approvals array

            @heads=@approvals.collect{ |item| item.func_hd+obj_code }.uniq

       

      where I'm interested in getting the unique values from a combination of func_hd and obj_code, but it does not work.