OK, I have more than 1 million records and I have to choose all the information from the database where the column count is high Or equal to 10
I know that I must use group and should use it where I can not use the aggregate function with the operator, so what should I do in pseudo code
< Select Code> Column 1, Column 2, Column 3, where gate (column 1) & gt; 10
This is where I get stuck. Do I use a subquery and add a counting column? I'm not sure how I will write codes by hand and I'm the beginning SQL user, I can see completely in the wrong direction.
My entire query is below, I want to modify it if only the record with the callid will be selected> = 10.
Select FiscalMonthYear, 'MyCenter' = Case EP.Center when "Livermore call center 'then' LCC 'when' NATOMAS call center 'then' NCC 'when' Concord call center 'again 'CCC' when 'Virtual Call Center' then 'VCC' when 'Morgan Hill Call Center' then 'MHCC' or center center, ECH.segstart, ECH.consulttime, EP. Qatar, (EP.MgrFName + '' + EP.MgrLName) as managers, (EP.SupFName + '' + EP.SupLName) supervisor, as (EP.RepFName + '' + EP.RepLName) agent, as EP.RepPERNR, Left (ECH.segstart, 19) SegmentDateTime, ECH.origlogin, ECH.dialed_num, ECH.segment, ECH.SegStart_Date, ECH.callid CMS_ECH.dbo.CaliforniaECH ECH Siapielsiaks as internal JO 2 In. ECH at Infocuccess DBOIQMFE_Avaya_IDA Orglogin = a. During Aviaid and Dot Det () initially and during the expiry period, join the capsule 2 Infocoust Dobo. IQMEGPOFILE_E3 AP AICID = EP. Between RepetoSpace_StartDate and RepToSup_EndDate and getdate () between repaid and dotdit (), join RepPueue_StartDate and RepQueue_EndDate INNER between SupToMgr_StartDate and SupToMgr_EndDate and getdate (), CalDReporting.dbo.udFiscalMonthTable F ECH.SegStart_Date = f.Tdate between where dialed_num ' ______ "do not like and do not dialed_num not like 'no' and 'dialed_num' _______ 'and EP.Center clear and EP.Center' com Ops 'not like EP.Center' same day Group not like MgrLName does not like 'Holman' and consulttime & gt; Between 0 and getdate (), between ECH.SegStart_Date - 90 and getdate () - 1 and not in EP.Queue ('BST', 'Collection', 'DST', 'DSR', 'Growth', 'Cable Store' ) I have a problem that selects the top 10 and combines all the data on the dialed column_anell column, internally joining the problem has solved the problem. Thanks for your help! First, determine which ECH data is more than 10 colored coded code)
P>
Select the CMS_ECH.dbo.California ECH ECH Group from ECH.callid Calculate by ECH.callid (*) & gt; 10 Then you can use it as a sub-section to filter your results:
... from ECH .. where ECH.callid iN (select to ECH.callid by CMS_ECH.dbo.California ECH ECH group ECH.callid (*) & gt; 10)
Comments
Post a Comment