Not a group by Expression
I have the following table AR_Complex
Country_code | Country | Complex_Amt | Child_Amt |
CC_1 | CC | 5000 | 1000 |
CC_1 | CC | 1000 | |
CC_1 | CC | 2000 | |
CC_1 | CC | 1000 | |
US_2 | WE | 3000 | 1000 |
US_2 | WE | 500 | |
US_2 | WE | 200 | |
US_2 | WE | 100 |
I wrote the following query
Select * from (select Country_code, sum (Complex_Amt), sum (Child_Amt), (sum (Complex_Amt) - sum (Child_Amt)) as a Diff of AR_Complex
Country_code group)
where Diff > 1
which works very well.
How can I get the Country column in the query because when I adds the Country column it does not appear a group by EXPRESSION.
I think you want:
Select * from (select Country_code, country, sum (Complex_Amt), sum (Child_Amt), (sum (Complex_Amt) - sum (Child_Amt)) as a Diff of AR_Complex
Country_code group, country)
where Diff > 1
Tags: Database
Similar Questions
-
Listagg function gives ORA-00979: not a GROUP BY expression error
Hello
I have an environment that supports the Listagg function. Suite works perfectly:
Select task_code, LISTAGG(ename||) e ('| role |') (',',') WITHIN GROUP (ORDER BY ename) as employees
team
where task_code = '01.07.05'
Task_code group
However, this is just a test request, the real is a little wider and I can't get the function works, I get ORA-00979: not a GROUP BY expression error.
Here's my query (the column names are in Dutch, but that shouldn't really be a problem):
SELECT distinct op_sod.sod_code, op_sod.sod_omschr_lang, op_ood.ood_code, op_ood.ood_omschr_lang, op_activiteit.act_code, op_activiteit.act_omschr_lang, op_taak.taak_code, op_taak.taak_omschr_lang, op_afdeling___master.afd_code, op_taak.belmo, op_taak_j.planning_la,
LISTAGG (op_ploeg.wn_naam |) ' ('| op_ploeg.rol |') (',',') WITHIN GROUP (ORDER BY op_ploeg.wn_naam) as employees.
"Write subtaak/mijlpaal toe."
op_teamplanning.subtaak_mijlpaal as subtaak_of_mijlpaal,
op_teamplanning.subtaak_omschr | -case when op_teamplanning.subtaak_mijlpaal = 'BELMO Mijlpaal' then ' (BRUNO mijlpaalnr: ' | nvl (op_teamplanning.nummer, 0) |) ')' other ' ' end
as subtaak_mijlpaal_omschrijving, op_teamplanning.deadline as date limit, op_teamplanning.status as status,
trim (both
case when op_teamplanning.vlag1 = 'Geen' and op_teamplanning.vlag2 = 'Geen' and op_teamplanning.vlag3 = 'Geen' and op_teamplanning.vlag4 = 'Geen'
and op_teamplanning.vlag5 = 'Geen' or op_teamplanning.vlag1 is null and op_teamplanning.vlag2 is null and op_teamplanning.vlag3 is null
op_teamplanning.vlag5 is null and op_teamplanning.vlag4 is null then 'Geen '.
Another pad (both case when op_teamplanning.vlag1 = 'Geen' then "else trim (both from op_teamplanning.vlag1) end) |
trim (both case when op_teamplanning.vlag2 = 'Geen' then "another ',' | trim (both from op_teamplanning.vlag2) end) |
trim (both case when op_teamplanning.vlag3 = 'Geen' then "another ',' | trim (both from op_teamplanning.vlag3) end) |
trim (both case when op_teamplanning.vlag4 = 'Geen' then "another ',' | trim (both from op_teamplanning.vlag4) end) |
trim (both case when op_teamplanning.vlag5 = 'Geen' then "another ',' | trim (both from op_teamplanning.vlag5) end) end) as Beleidsvlaggen,
op_teamplanning.naam_verantw as quotation, op_teamplanning.subtaak_id as subtaak_id, nvl (op_teamplanning.nummer, 0) as Nummer, nvl (op_teamplanning.regelgevingsagenda, 'Nee') as
Regelgeving, op_teamplan_subsubtaak.subsubtaak_submijlpaal as subsubtaak_submijlpaal, op_teamplan_subsubtaak.subsubtaak_id as subsubtaak_id, op_teamplan_subsubtaak.subsubtaak_omschr
like subsubtaak_omschr, op_teamplan_subsubtaak.deadline, sub_deadline, op_teamplan_subsubtaak.status as sub_status, op_teamplan_subsubtaak.naam_verantw as naam_verantw
Of...
WHERE THE...
Group of op_sod.sod_code, op_sod.sod_omschr_lang, op_ood.ood_code, op_ood.ood_omschr_lang, op_activiteit.act_code, op_activiteit.act_omschr_lang, op_taak.taak_code, op_taak.taak_omschr_lang, op_afdeling___master.afd_code, op_taak.belmo, op_taak_j.planning_la
Can someone tell me the reason for this error?
Thanks in advance!
Kind regards
NDG
NDG123 wrote:
I don't really understand your other question:
Is below for example, a group of expression?
op_teamplanning.subtaak_mijlpaal
After some additional research:
The group by mistake is not appear anymore when I delete all fields after the listagg field, that might be a clue to the solution.
It is not difficult to understand. You can have other columns not aggregated in your projection on the side of those listed in the group by expression.
The reason for ORA-01489 is that the resulting string will become long and exceeds 4000 bytes.
You will find several solution in this forum.
For example
-
error: not a GROUP BY expression
Hello world
Looks like I need some help here... :) don't know what that means, but im getting this message
00979 00000 - "not a GROUP BY expression"
* Cause:
* Action:
Error on line: column 137: 36
It's the function:
function get_path (materialID in number, materialTypeID number, inTopFolderID number default null, inMaterialFolderID in the number default null, webMode in default number 1 in)
return varchar2;
and im using it on my query
, (select material_util.get_path (m.material_id, 8, 1021695, min (mf.)) (IP_MATERIALFOLDERID), 1).
material m, materialfolder mf
where mf.nfx_link = m.MATERIAL_ID
and t.template_id = m.template_id) as path
It seems that min (mf. IP_MATERIALFOLDERID) is having some problems here... don't know why...
Let me know guys...
Thank you...
JRead below for informative post from Frank Kulash on ABC in the group by clause
{message: id = 9969583} -
SQL - ORA-00979: not a GROUP BY expression
Hi Expert,
I received the error message: ORA-00979: not a GROUP BY expression at the bottom of the sql statement
Please advise - display total number of point of sale and the total amount of all items. Only display results when the total quantity is greater than 2.
SELECT o.Qty, sum(o.Qty*o.salesprice) AS TOTALDOLLARS, description and i.Itemcode
OF ORDERLINE o
INNER JOIN POINT I
ON o.itemcode = i.itemcode
GROUP BY i.Itemcode
After having o.qty > 2
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
Create table ORDERLINE
(
Qty number 4,
Salesprice Number (6.2),
OrderNo Number (3).
ItemCode Varchar2 (6).
Primary key (OrderNo, Itemcode)
Foreign Key (Itemcode) refers to POINT.
Foreign Key (OrderNo) made reference SALESORDER
Create table POINT
(
ItemCode Varchar2 (6).
Description Varchar2 (50).
Retailprice Number (6.2),
Number of weight (4.1),
Purchaseprice Number (6.2),
Category Varchar2 (20).
Primary Key (Itemcode)
);Hi 845720,
Based on the sql code, the sum must be grouped itemcodewise, descriptionwise, qtywise.
This means that you have all these in a group by clause too with sum().eg : group by i.Itemcode, i.Description, o.Qty
Is this wise sum qty is logical? I do not know...
It will be useful,
CKLPPublished by: CKLP April 14, 2011 22:10
-
Subquery in the select clause and not "a group by expression" error.
Hi all
I hope someone out there can help me out with this one. I have a sql query that performs a subquery in the select case combined with an aggregate function and gives me a "not a group by expression.
I created a simplified example
I'm sure he expected me to add the po_number to the group by clause, but this does not work and gives the error "invalid identifier".SELECT COUNT(*) , ai.invoice_num invoice_number , ai.description invoice_description , (SELECT poh.po_header_id FROM po_headers poh , po_distributions pod WHERE pod.po_distribution_id = aid.po_distribution_id AND pod.po_header_id = poh.po_header_id ) po_number FROM ap_invoice_distributions aid , ap_invoices ai WHERE ai.invoice_id = 1476932 AND aid.project_id = 8608 AND aid.task_id = 462202 AND ai.invoice_id = aid.invoice_id GROUP BY ai.invoice_num, ai.description;
Can someone suggest a way for a new concert the query so that I can add po_number to my education by clause.
KrisYou should try either:
SELECT COUNT (*),
AI.invoice_num invoice_number,
have. Description invoice_description,
(SELECT poh.po_header_id
OF po_headers poh,.
pod po_distributions
WHERE pod.po_distribution_id = aid.po_distribution_id
AND pod.po_header_id = poh.po_header_id
) po_number
HELP ap_invoice_distributions.
ap_invoices AI
WHERE ai.invoice_id = 1476932
AND aid.project_id = 8608
AND aid.task_id = 462202
AND ai.invoice_id = aid.invoice_id
Ai.invoice_num GROUP,
have. Description, aid.po_distribution_id;or
SELECT COUNT (*),
AI.invoice_num invoice_number,
have. Description invoice_description,
MAX ((SELECT poh.po_header_id
OF po_headers poh,.
pod po_distributions
WHERE pod.po_distribution_id = aid.po_distribution_id
AND pod.po_header_id = poh.po_header_id
po_number))
HELP ap_invoice_distributions.
ap_invoices AI
WHERE ai.invoice_id = 1476932
AND aid.project_id = 8608
AND aid.task_id = 462202
AND ai.invoice_id = aid.invoice_id
Ai.invoice_num GROUP,
have. Description; -
Not a group by expression error
Hello
Can you please tell me why the query below is to launch one isn't a group by expression error
Select count (*),
TO_CHAR (date, "YYYYMM") table
To_char (date, 'yyyymm') group;
Basically I want a count by month.
Help, please
Thank you
Check the status of Tom on this thread, which seems similar to your problem:
-
ORA-00979: not a GROUP BY expression
Hello
And if you want to include aggregate functions, you must make sure of all the other columns are included in the group by clause...
SELECT THE CAG. SystemId,
CAG. BankId,
CR. ClearingNumber,
CAG. AgreementId,
CAs.timestampchanged AS ApprovedLGDDate,
LGD. ApprovedLGDValue,
CASE. ModelId,
CASE. ModelVersion,
CAG. CaseId,
CASE. Creator,
BOX WHEN CAG. SystemId = 'ASK' THEN CAG. SystemidProduct
ANOTHER NULL
END as SystemidProd,
BOX WHEN CAG. SystemId = 'REQUEST' AND CAG.agreementid LIKE ' %: % ' THEN
To_char (TO_NUMBER (SUBSTR (CAG.agreementid, INSTR (CAG.agreementid, ' :') + 1), "xxxxxxxxxxxxxxx")))
WHEN CAG. SystemId = 'REQUEST' AND CAG.agreementid NOT LIKE ' %: % ' THEN
CAG.agreementid
ANOTHER NULL
END as AgreementidUNP,
case. DecisionDate
OF CAG CustomerAgreement
JOIN CreditLGD LGD ON (CAG. SystemId = LGD. SystemId
AND CAG. BankId = LGD. BankId
AND CAG. AgreementId = LGD. AgreementId
AND CAG. AgreementSubId = LGD. AgreementSubId
AND CAG. CaseId = LGD. CaseId
)
Credit to JOIN CR ON (CAG. SystemId = CR. SystemId
AND CAG. BankId = CR. BankId
AND CAG. AgreementId = CR. AgreementId
AND CAG. AgreementSubId = CR. AgreementSubId
AND CAG. CaseId = CR. CaseId
)
NO. CASE CASE OF JOIN ON (CAG. BankId = CASE. BankId
AND CAG. CaseId = CASE. CaseId
AND THE AC. State = 'approved '.
)
JOIN CU customer ON (CU.bankid = CAS.bankid
AND CU.latestapprovedcaseid = CAS.caseid
AND CU.customerid = CR.customerid
)
WHERE CAG. SYSTEMID IN ("ACC", "APL", "GOF", "GRK", "HPD", "KRF", "LIM", "PRO", "SPI", "SPS", "ASK")
CAG group. SystemId
CAG. BankId
CR. ClearingNumber
CAG. AgreementId
cas.timestampchanged
LGD. ApprovedLGDValue
CASE. ModelId
CASE. ModelVersion
CAG. CaseId
CASE. Creator
CASE WHEN CAG. SystemId = 'ASK' THEN CAG. SystemidProduct
ANOTHER NULL
END
CASE WHEN CAG. SystemId = 'REQUEST' AND CAG.agreementid LIKE ' %: % ' THEN
To_char (TO_NUMBER (SUBSTR (CAG.agreementid, INSTR (CAG.agreementid, ' :') + 1), "xxxxxxxxxxxxxxx")))
WHEN CAG. SystemId = 'REQUEST' AND CAG.agreementid NOT LIKE ' %: % ' THEN
CAG.agreementid
ANOTHER NULL
END
cas.decisiondate -
ORA-00979: not a GROUP BY expression error
Hi all
I added a GROUP BY clause that includes all expressions of individual column listed.
I don't know why this error occurs. ?
How could I solve this problem?
SELECT site_to_data_source_lane_v.site_id, site_to_data_source_lane_v.site_lane_id, traffic_record.record_id, traffic_record.datetime, NVL(traffic_class.v_class, 0), NVL(SUM(traffic_status.status_code), 0) vehicle_status_count, NVL(COUNT(traffic_error.error_code), 0) vehicle_error_count , NVL(site_to_data_source_lane_v.site_lane_id, 0) , NVL(traffic_status.status_code, 0), NVL(traffic_error.error_code, 0) FROM traffic_record LEFT OUTER JOIN traffic_class ON traffic_record.record_id = traffic_class.record_id LEFT OUTER JOIN traffic_error ON traffic_record.record_id =traffic_error.record_id LEFT OUTER JOIN traffic_status ON traffic_record.record_id =traffic_status.record_id JOIN site_to_data_source_lane_v ON traffic_record.data_source_id = site_to_data_source_lane_v.data_source_id AND traffic_record.lane = site_to_data_source_lane_v.data_source_lane_id JOIN edr_rpt_tmp_report_lanes ON site_to_data_source_lane_v.site_lane_id = edr_rpt_tmp_report_lanes.site_lane_id JOIN edr_rpt_tmp_report_classes ON NVL(traffic_class.v_class, 0) = edr_rpt_tmp_report_classes.class_id JOIN edr_rpt_tmp_inclusion_table ON TRUNC(traffic_record.datetime) = TRUNC(edr_rpt_tmp_inclusion_table.date_time) WHERE site_to_data_source_lane_v.site_id = 32 AND traffic_record.datetime >= to_timestamp('07/01/2008 00:00:00', 'mm/dd/yyyy hh24:mi:ss') AND traffic_record.datetime < to_timestamp('07/31/2008 00:00:00', 'mm/dd/yyyy hh24:mi:ss') GROUP BY site_id, site_lane_id, record_id, date_time, v_class, status_code, error_code;
You choose: -.
site_to_data_source_lane_v.Site_ID,
site_to_data_source_lane_v.site_lane_id,
traffic_record.record_id,
traffic_record. DateTime,
NVL (traffic_class.v_class, 0),
NVL (Sum (traffic_status.status_code), 0) vehicle_status_count,
NVL (Count (traffic_error. (Error_code), 0) vehicle_error_count,
NVL (site_to_data_source_lane_v.site_lane_id, 0),
NVL (traffic_status.status_code, 0),
NVL (traffic_error.error_code, 0)But you are a grouping by
Site_ID,
site_lane_id,
record_id,
Date_Time,
v_class,
status_code,
Error_codeQuite a few differences...
-
SQL error: ORA-00979: not a GROUP BY
Hi team,
I am trying to execute the query
SELECT DISTINCT comp.company_name |' -' || COMP.contract_number AS 'company_name '.
, UPPER (bh.first_name) AS 'budget_holder '.
, INITCAP (sup.first_name) |' -' || SUP. Surname AS 'supervisor '.
, INITCAP (emp.status) AS "Department".
, INITCAP (emp.first_name |) » '|| EMP. Surname) AS "employee."
r.employee_id
, emp.paaf_number AS 'paaf_num '.
, emp.employee_payroll_number AS 'payroll_num '.
, emp.discipline AS 'discipline '.
, NVL (SUM (tg.week_day1), 0) AS "day 1".
, NVL (SUM (tg.week_day2), 0) AS "day 2".
, NVL (SUM (tg.week_day3), 0) AS day '3 '.
, NVL (SUM (tg.week_day4), 0) AS "day4.
, NVL (SUM (tg.week_day5), 0) AS "day5".
, NVL (SUM (tg.week_day6), 0) AS "day6.
, NVL (SUM (tg.week_day7), 0) AS "day 7".
r.valid_from
r.valid_to
Tw_roster_data r
JOIN tw_employee emp
ON emp.employee_id = r.employee_id
JOIN tg tw_timesheet_stage
ON tg.employee_id = r.employee_id
AND tg.week_commencing = r.valid_from
JOIN the tw_contracting_company comp
ON comp.contracting_company_id = r.contracting_company_id
JOIN tw_supervisor sup
ON sup.supervisor_id = tg.supervisor_id
JOIN tw_budget_holder bh
ON bh.budget_holder_id = sup.budget_holder_id
WHERE r.contracting_company_id = 101
AND r.VALID_FROM = January 31, 2015.
AND r.VALID_TO = February 6, 2015"
Group of r.employee_id, comp.company_name, bh.first_name,
EMP.paaf_number, emp.employee_payroll_number, emp.discipline,
r.valid_from, r.valid_to;
But still the error below
Error in the command line: 1 column: 17
Error report-
SQL error: ORA-00979: not a GROUP BY expression
00979 00000 - "not a GROUP BY expression"
Can help.
Hello
When to use analytical function oracle other columns used based on the analysis, must be included in the GROUP BY Clause
SELECT expression1, expression2, ... expression_n, aggregate_function (expression) FROM tables WHERE conditions GROUP BY expression1, expression2, ... expression_n;
SQL 101: Seen are medium and other aggregate data
SELECT DISTINCT comp.company_name || ' - ' || comp.contract_number AS "company_name", UPPER (bh.first_name) AS "budget_holder", INITCAP (sup.first_name) || ' - ' || sup.surname AS "supervisor", INITCAP (emp.status) AS "department", INITCAP (emp.first_name || ' ' || emp.surname) AS "employee", r.employee_id, emp.paaf_number AS "paaf_num", emp.employee_payroll_number AS "payroll_num", emp.discipline AS "discipline", NVL (SUM (tg.week_day1), 0) AS "day1", NVL (SUM (tg.week_day2), 0) AS "day2", NVL (SUM (tg.week_day3), 0) AS "day3", NVL (SUM (tg.week_day4), 0) AS "day4", NVL (SUM (tg.week_day5), 0) AS "day5", NVL (SUM (tg.week_day6), 0) AS "day6", NVL (SUM (tg.week_day7), 0) AS "day7", r.valid_from, r.valid_to FROM tw_roster_data r JOIN tw_employee emp ON emp.employee_id = r.employee_id JOIN tw_timesheet_stage tg ON tg.employee_id = r.employee_id AND tg.week_commencing = r.valid_from JOIN tw_contracting_company comp ON comp.contracting_company_id = r.contracting_company_id JOIN tw_supervisor sup ON sup.supervisor_id = tg.supervisor_id JOIN tw_budget_holder bh ON bh.budget_holder_id = sup.budget_holder_id WHERE r.contracting_company_id = 101 AND r.VALID_FROM = '31-JAN-2015' AND r.VALID_TO = '06-FEB-2015' GROUP BY comp.contract_number ,comp.company_name ,bh.first_name ,sup.first_name ,sup.surname , emp.status ,emp.first_name ,emp.surname r.employee_id, emp.paaf_number, emp.employee_payroll_number, emp.discipline, r.valid_from, r.valid_to;
-
In Outlook Express, how can I send the same message to the large group (already in the address book), but have to each recipient can only see his name (not the Group)?
To use the functionality of the BCC (Blind Carbon Copy), in a new message window, click View | All headers and type the addresses separated by a; Or: Click the button to. You will see your list of contacts and the choice to put them in the To, CC, or BCC field. Click on an address, and then click BCC to add it. Repeat for all of the contacts you want. (Note: most of the providers have limits as to how many messages you can send both a. 25 is common, but it varies).
Put your own address in the box to. That's the only name/address that any recipient will see. If you leave the field empty, some people may not receive e-mail because of message rules they put in place, or restrictions imposed by their ISP.
You can also make an entry in the address book using your e-mail address, but put something like the mailing list in the area of the display.
*********************
You can also create groups if you send e-mail to the same people often.
To create a group of contacts:
You can create a single group name (or alias) to use when sending a message to several contacts at the same time. Just create a group name and add individual contacts to the group. Then just type the name of the group in the box for when you send mail.
1. in the address book, select the folder in which you want to create a group. Click New in the toolbar, and then click New Group.
2. the Properties dialog box opens. In the group name box, type the name of the group.
3. There are several ways to add people to the Group:
a. to add a person from your address book list, click Select members, and then click a name in the address book list.
(b) to add a person directly to the group without adding the name to your address book, type the person's name and e-mail address at the bottom of the Properties dialog box and then click Add.
to add a person to both the Group and your address book, click New Contact and enter the appropriate information.
(d) to use a directory service, click Select members, and then click search. Select a directory service in the drop-down list at the end of the text box. After finding and selecting an address, it is automatically added to your address book.
4. Repeat for each addition until your group is defined.Note
a. to view a list of your groups separately from the list of address book in the address book on the view menu, make sure that folders and groups is selected.
b. you can create multiple groups, and contacts can belong to several groups.If you want to send to a group without addresses are displayed for each recipient, open the address book and make a new entry. Enter the name of the group in the area of the display, but use your address. (Some Internet service providers require a legitimate address in the line to and recipients will know it's from the Group).
Click on the button to. Enter the name of the group using your address. Enter the group in the BCC field.
-
I can receive all messages from whatsapp on my Apple Watch, but not the Group whatsapp messages, don't know why... Help, please.
Besides, my watch is custom in Spanish, but only answer messages Whatsapp understands English... anyone know why? Thanks to you all!
Hello
To change the language for a response on your watch: Press answer > firmly press the screen > press on choose language > select Spanish.
-
I had a linear new extreme connection (connected to the wireless model Cat5) related to the old extreme then Express (newish).
I would have put in place using airport Utility (for example) 4 years ago and has worked well.
I changed my wireless modem (formerly broken) but cannot now reconnect the old extreme and express to the extreme again.
The extreme new connects to internet just fine as long as it is in Bridge mode (does not work in DHCP/NAT mode).
My real question is the utility software Airport now seems not to recognize the Express extreme or old old to get re-connected.
The manual of Apple still shows configurations using the old utilitarian approach Airport (with each unit sitting on LHS page)
If you're still using OS X (10.5.8)... as, you enter in your profile information... then the AirPort Utility in this operating system must be able to recognize the old AirPort Extreme and Express.
However, if you have updated to a new operating system such as the Mountain Lion (10.8.x), Mavericks (10.9.x), Yosemite (10.10.x) or El Capitan (10.11.x)... and... you have more "round" or version 'dome' in the form of AirPort Extreme, and an old version of the AirPort Express A1084... so, the new version of AirPort Utility is not compatible with older airports.
So, this would help a lot if we could get clarification from your part...
(1) what operating system you're using now? If you are not sure about this, click on the Apple icon in the upper left corner of the screen, then click on about this Mac and post back with the Version of OS X number that you see there.
(2) what version of the AirPort Extreme you may have. Is it a 'rounder', or 'dome' in the form of version... or... The "flat" or "square" version? If you have flat or square version, the number of model of the device is required. It is on the lower part of the airport, probably integrated in the base of carpet of MOSS. The model number starts with an 'A' follow-up of four digits. Please post back this information.
(3) what version of AirPort Express you have? Please look for the model number on the side of the Express. It is difficult to see, with grey lettering in a certain context, so you need to perhaps good lighting and glasses to discern the number of reading. As extreme, the Express, model number starts with an 'A' followed by four digits. Please post back this information.
Once we have the information we need, we know more about how to proceed from this point.
-
Hi all
Can someone tell me what is wrong with the query below? I get an exception is NOT a GROUP OF CLAUSE:
SELECT LAST_DAY((xxx.timevalue)) as SUMMARYDATE , xxx.acct AS ACCTNUM , xxx.referenceid AS SEARCHTYPE , CASE WHEN NVL(xxx.PRIMARYSRCH_IND,'N') = 'Y' THEN COUNT(xxx.searchid) ELSE 0 END Cnt_PrimarySearches , CASE WHEN NVL(xxx.primarysrch_ind,'N') = 'N' THEN COUNT(xxx.Searchid) ELSE 0 END Cnt_SecondarySearches FROM XXX_Tablename xxx WHERE xxx.referenceid NOT IN ('Alert','Search','Collection') GROUP BY LAST_DAY((xxx.timevalue)) , xxx.acctnum , xxx.referenceid
Hello
Try this
SELECT LAST_DAY((xxx.timevalue)) as SUMMARYDATE , xxx.acct AS ACCTNUM , xxx.referenceid AS SEARCHTYPE ,COUNT( CASE WHEN NVL(xxx.PRIMARYSRCH_IND,'N') = 'Y' THEN (xxx.searchid) ELSE 0 END Cnt_PrimarySearches) , COUNT(CASE WHEN NVL(xxx.primarysrch_ind,'N') = 'N' THEN (xxx.Searchid) ELSE 0 END) Cnt_SecondarySearches FROM XXX_Tablename xxx WHERE xxx.referenceid NOT IN ('Alert','Search','Collection') GROUP BY LAST_DAY((xxx.timevalue)) , xxx.acctnum , xxx.referenceid
Not tested
-
Thunderbird does not recognize groups of outlook express news. What can I do to fix?
Years, I had no problem emailing messages to my Outlook Express news groups. Now, when I try to do, I get a message saying that the news group "is not a valid email address because it is not of the form user@host.» Thanks for your help.
See the bug:
Please register and add comments stating what OS you are using and what version of thunderbird. then Vote for the bug - this at the top:
- Importance:-normal (vote)
(Vote) is a link: click on it. Select the check box for the bug and click the button "change my voice."
Workaround solution:
Comment of Fabian Rodriguez 2014-09-04 06:19:15 PDT
Confirmed workaround solutions:
- All by composing an email open the address book and select the list you want to send, to highlight all the names in the list and drag them to the To: box. This example uses your existing data without changing it.
- Replace white "" between the words in the descriptions of these lists with an underscore "_". This requires modification of your descriptions of mailing list (s).
-
ORA-00979: not a GROUP-BY-error expression
Hello
We moved just our project mysql database to oracle 10 database. The migration was made manually, without the use of tools. We had to change many queries to oracle suit. The following query when it is run on mysql works perfectly well. But when I run it in oracle, it gives the error mentioned in the subject.
-----
Select distinct d.managedserverid, s.hostname, m.port, a.applicationname, max (d.versionid) of table1, table2 m, s table3, table 4 d, where d.applicationid = '1' and d.Active = 'True' and d.managedserverid = m.managedserverid and m.serverid = s.serverid and d.applicationid = a.applicationid group by d.managedserverid;
-----
Any help would be appreciated.
Thank you
SAPPHello
Welcome to the forum.
When you use the aggregate functions such as min, max, sum, etc. you have to group the columns not aggregated in the select query.
Try this.
select d.managedserverid, s.hostname, m.port, a.applicationname, max(d.versionid) from table1 d, table2 m, table3 s, table4 a where d.applicationid = '1' and d.Active = 'True' and d.managedserverid = m.managedserverid and m.serverid = s.serverid and d.applicationid = a.applicationid group by d.managedserverid, s.hostname, m.port, a.applicationname
HTH,
Prazy
Maybe you are looking for
-
On the usual comments page, there is no subject for sending your comments on the communities of Apple. Other that the beast will look: 1. pages load very slowly. It's on my end iMac of 2013 with a 150 megabit connection to the Internet. This is in
-
How can I clean my mac? Is there a good program?
How can I clean my mac of junk? Is there a good program?
-
HP flow: Message "System disabled" HP flow
I just bought a stream of my granddaughter HP but I can't enter. A message arrives that reads "System disabled" How can I get past this?
-
Pavilion p6 - 2220t Desktop can't see Gygabyte GV - N210D3 - 1GI graphics card
I added a graphics card from Gigabyte GE Force 210 GV-N210D3 - 1GI to my desktop HP Pavilion W7 p6 - 2220t. Reason: p6 - 2220t came with DVI (without Audio), and I need full HDMI. The card went to the fine and certainly relies on the motherboard. Bu
-
How can I connect Windows when I forgot my password