-- #df:entity#

-- !df:pmb extends SPB!
-- !!Date fromRequestedTime:fromDate!!
-- !!Date toRequestedTime:toDate!!

/*IF pmb.isPaging()*/
select
-- ELSE select count(*) from (select
/*END*/
  SEARCH_QUERY as name,
  count(SEARCH_QUERY) as cnt
 from SEARCH_LOG 
 /*BEGIN*/where
   /*IF pmb.fromRequestedTime != null*/
   REQUESTED_TIME >= /*pmb.fromRequestedTime*/'2009-10-26 00:00:00'
   /*END*/
   /*IF pmb.toRequestedTime != null*/
   and REQUESTED_TIME < /*pmb.toRequestedTime*/'2009-10-30 00:00:00'
   /*END*/
 /*END*/
 group by SEARCH_QUERY
/*IF pmb.isPaging()*/
 order by count(SEARCH_QUERY) desc
-- ELSE )
/*END*/
