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
Re: Listagg function excdding 4000 characters
Tags: Database
Similar Questions
-
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 - 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
-
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 -
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;
-
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-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 -
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} -
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
-
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
-
Listagg function displays the keyword not found error message
is version of Oracle 11 g
can you please suggest me to find exactly the problemcreate or replace function fn_months_attended return number is v_array varchar2(1000); begin select LISTAGG(c.act_id,',') within group (order by c.act_id desc) INTO V_ARRAY from programmes a,campaigns b,activities c where a.pro_id=b.cam_pro_id and b.cam_id=c.act_act_id order by act_id DESC ; return v_array; end; Error i received Error(6,3): PL/SQL: SQL Statement ignored Error(6,39): PL/SQL: ORA-00923: FROM keyword not found where expected
Hello
In the LIST of 11 GR 1 tot material. function does not work. It works in only 11 GR 2.
Kind regards
Champion. -
My computer, a Pavilion a6110n (a few years), had to have the hard drive erased because of a virus that has deeply infected in Vista Home Premium. To reinstall Vista, I tried using the recovery discs HP than the guys at Best Buy is when we bought the computer.
At startup (with the CD group first in the boot order), I get an error-"CDBOOT: cannot find the BOO." BISHOP. "
What could be my problem? I tried other discs to restore to another brand of computer (also made by Best Buy) and I get no BOO. MGR error, only an error specific to the manufacturer I can only assume means that I can't use the floppy drive in my HP. could my Best Buy-made restore disks to be missed altogether Boot Manager? If so, how are we dealing with the repair without spending money?
Here's a noob question, too: these recovery re discs - installed Vista or I'm completely screwed? Thanks in advance for your comments
You can order the HP recovery media for about $20. Indeed, the set formed by Best Buy seems very defective. Dynex is a cheap brand of the DVD and for the price, I bet what they charged for this ' extra service ' they should have used a good quality brand.
BTW, you could have done the same thing for free, apart from the cost of a few HP machines with the software installed to burn a set of recovery DVD.
You could also "disappeared" the clean hard disk by starting on HP Recovery Manager to a formatting and reinstalling.
-
ORA-00979 in one but not the other. Why?
Oracle Database 11 g Enterprise Edition Release 11.1.0.6.0 - 64 bit Production
SELECT the 'X' WHEN A.Dummy 42 THEN END OF double, (SELECT Dummy FROM Dual) a GROUP OF Dual.Dummy;
SELECT the 'X' WHEN A.Dummy 42 THEN END OF double, (SELECT ' X' FROM Dual Dummy) a GROUP OF Dual.Dummy;
First an error: ORA-00979: not a GROUP BY expression
Other works.
Why?Hello
This seems to be a transformation/display fusion issue queries. You can replicate the behavior in the second query using the no_merge hint...
SELECT CASE 'X' WHEN A.Dummy THEN 42 END FROM Dual, (SELECT /*+ no_merge */ 'X' Dummy FROM Dual) A GROUP BY Dual.Dummy; SELECT CASE 'X' WHEN A.Dummy THEN 42 END FROM Dual, (SELECT 'X' Dummy FROM Dual) A GROUP BY Dual.Dummy; XXXX> SELECT 2 CASE 'X' WHEN A.Dummy THEN 42 3 END 4 FROM 5 Dual, 6 (SELECT /*+ no_merge */ 'X' Dummy FROM Dual) A 7 GROUP BY 8 Dual.Dummy; CASE 'X' WHEN A.Dummy THEN 42 * ERROR at line 2: ORA-00979: not a GROUP BY expression Elapsed: 00:00:00.03 XXXX> XXXX> SELECT 2 CASE 'X' WHEN A.Dummy THEN 42 3 END 4 FROM 5 Dual, 6 (SELECT 'X' Dummy FROM Dual) A 7 GROUP BY 8 Dual.Dummy; CASE'X'WHENA.DUMMYTHEN42END --------------------------- 42 1 row selected.
If you run a trace 10053, you should be able to see the specific cause
HTH
David
BANNER ---------------------------------------------------------------- Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi PL/SQL Release 10.2.0.4.0 - Production CORE 10.2.0.4.0 Production TNS for Solaris: Version 10.2.0.4.0 - Production NLSRTL Version 10.2.0.4.0 - Production 5 rows selected.
Published by: Bravid on February 28, 2012 17:21
-
Hi all
I touched the following situation where queries running on a cool environment 11 g and I can not find motivated of the Select to fail (or actually why he used of not not on 10 g).
Here is the example of select:
Select
ten
twelve
twenty
counter
Of
(
Select 10 10
12 as twelve
, (select count (*) of the double) as counter
20 like twenty years
the double)
Group by ten
If I run it on the 10g database completes successfully. On 11g, it triggers ORA-00979 not a group by expression.
I couldn't find the reason for this different behavior so I want to ask you.
Thank you in advance.
MartinIs this something like that?
Maybe you are looking for
-
HP Pavilion J6M42PA 15: I want to upgrade my ram
PRODUCT NAME: HP Pavilion 15 laptop PC PRODUCT NUMBER: J6M42PA Currently I have 8 GB of ram and I want to improve my ram... can I know how much memory I can improve and what ram should I buy.
-
Replacing the drive HARD on Satellite C series
Hello I want to replace and upgrade my hard drive internal sata, what is the maximum size that I can install which will fortunately be recognized by BIOS / chipset?
-
Install programs with low priority - priority of the change of Setup
I'm trying to find a way to change the priority of a Setup program when installing a program, in this case, iTunes to a lower priority. I just want to lower the priority of the installation process, not the software after installation. During the ins
-
Hello I am an application that uses the twitter API. I get the information I want and then I display in a list. The problem is that I would use a richtextfield instead of normal text, I draw using drawText, but how do I use a richtextfield in a row.
-
My laptop has become a Virtual Machine (Hyper-V) Help!
Hello a little backwards in Hyper-V installed server 2012 R2 manually my laptop is Windows 8 after I installed Hyper V my laptop whenever I start it starts on the server Hyper-V how Can I he was able to go back to Windows? When V hyper starts it give