Query statistical reports without keywords

Source: Internet
Author: User

Create or replace procedure P_114_SEARCHNT (o_Cursor Out sequence, I _Begindate In varchar2, -- start time I _Enddate In varchar2, -- end time I _citycode In varchar2 -- Address Code) /*************************************** * *** function: author: FC *************************************** * *****/is v_Begindate Date: = to_Date (I _Begindate, 'yyyy-mm-dd'); v_Enddate Date: = to_Date (I _Enddate, 'yyyy-mm-dd'); v_citycode varchar2 (20 ): = substr (I _citycode, 0, Instr (I _citycode, '|')-1); begin if v_citycode is null then v_citycode: = I _citycode; end if; open o_Cursor for select Keyword, count (1) as Searchtime, Searchcyc, Cityname from (select case when t. title is null then replace (t. content, 'query condition', ''), ':',''), '& nbsp;', '') else replace (t. title, 'query condition', ''), ':',''), '& nbsp;', '') end as Keyword, I _Begindate | 'to' | I _Enddate as Searchcyc, c. cityname as Cityname from T_WORKSHEET_LOG t, T_CITIES c where t. citycode = c. citycode and t. handledate> = v_Begindate and t. handledate <v_Enddate and t. action = 'A' and (t. citycode = v_citycode or 'gz '= v_citycode) group by Cityname, Keyword, Searchcyc; end P_114_SEARCHNT;

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.