This is how I've been using it, now currently replaced with "30 days" 
manually.  I'd like to shove a variable in there.  

tm = PG::TypeMapByColumn.new([
  PG::TextEncoder::String.new
  ])
d = d.to_s

res = $conn.exec_params( %Q{ SELECT search_phrase, count(search_phrase) 
  FROM searches 
  WHERE creation_date::timestamp::date > (CURRENT_DATE - interval '$1 
days')::date 
    AND search_phrase != 'about'
  GROUP BY search_phrase 
  ORDER BY count(search_phrase) DESC }, [ d ], 0, tm ).to_a



-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sequel-talk+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/37db9845-c5bc-4771-af53-83cef8ee29da%40googlegroups.com.

Reply via email to