ok, that bought another round of confusion to me.  I am trying to use
Sequel v.3.0, but still am on Ruby v.1.8.7.  I guess one day I will
make the plunge to v.1.9.

Why the use of a hash in the order clause?  What if I only had one
element to sort case insensitive plus something else?  for example
sorting by last name and then id?

Emp.select( :id, :f_name ).order( { [lower( f_name )] }, :id )

returns 'odd number list for hash' error.




I just had another thought.  Which would be more efficient?  To let
the database (even if SQLite) to do the string concatenation or do it
after returning to Ruby?  I try to let databases do as much as
possible, since they are already optimized to number crunching and
analytics without me re-inventing the wheel.  But something as simple
as this is probably a wash, but just looking for all ya'lls thoughts.
As above:

  e = Emp.select( :id, ( :f_name.sql_string + :l_name ).as
( :name ) ) ...
  name = e[:name]

or

  e = Emp.select( :id, :f_name, :l_name ) ...
  name = e[:f_name] + ' ' + e[:l_name]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to