ORA-00937: not a single group group function
Hello world
I got an error above with followingcode... Please help me
SELECT
ROW_NUMBER() OVER (PARTITION OF LANEDIRECTION, ORDER BY TIMEID COSIT) AS RN, DAYASNUMBER,.
(to_date (timeid, 'YYYYMMDD hh24miss')) as cte.
drive ((to_date (timeid, 'AAAAMMJJ hh24miss')), 1) on next_start_date (partition by order lanedirection (to_date (timeid, 'YYYYMMDD hh24miss')));
VOLUME, (LEAD
volume)
DURING)
PARTITION BY dayasnumber, link_id
ORDER BY
DayAsNumber, link_id, (to_date (timeid, 'YYYYMMDD hh24miss'))) as next_volume,
Lag)
volume)
DURING)
PARTITION BY dayasnumber, link_id
ORDER BY
DayAsNumber, link_id, (to_date (timeid, 'YYYYMMDD hh24miss'))) as prior_volume,
COSIT,
LANEDIRECTION, AVGSPEED,
LINK_ID,
TO_CHAR ((to_date (timeid, 'YYYYMMDD hh24miss')), "hh24") that the hours,
12 AS EXPECTED_COUNT,
COUNT (TO_NUMBER (SUBSTR (TO_CHAR (timeid), 9, 2))) AS ACTUAL_COUNT,
CASE
WHEN COUNTY (TO_NUMBER (SUBSTR (TO_CHAR (timeid), 9, 2))) = 12
THEN
« N »
WHEN COUNTY (TO_NUMBER (SUBSTR (TO_CHAR (timeid), 9, 2))) = 11
THEN
'I '.
WHEN COUNTY (TO_NUMBER (SUBSTR (TO_CHAR (timeid), 9, 2))) < 6
THEN
« C »
ON THE OTHER
' O '
END
AS PATCHED
FROM (select DAYASNUMBER,
TimeID, COSIT,
LANEDIRECTION, VOLUME, AVGSPEED,
LINK_ID
OF C2_DATA_MIN where <>volume 0
DAYASNUMBER GROUP,
COSIT,
TimeID,
LANEDIRECTION, VOLUME, AVGSPEED,
LINK_ID);
Thanks in advance
You have an aggregate count that needs a group by clause, you may need to use over().
Also, what type of data is timeid? If it is a DATE, you should not use to_date on it. If it is of type VARCHAR,
You should not use to_char on it. Do you both, so let's not.
If it's a DATE, never use to_char with a format mask.
Tags: Database
Similar Questions
-
Hello
I have this request with meselect mst.ENTRY_DATE ordered_date , mst.FIELD, V.ADDRESS1 Address , OPN_JOB_DESC job_number, ra.CUSTOMER_NAME customer_NAME, DECODE ( GROSS_ITEM_REF , NULL , SUBSTR (PRODUCT_ATTR_VAL_DISP , INSTR( PRODUCT_ATTR_VAL_DISP, '.', -1, 1) + 1 ) , GROSS_ITEM_REF ) item_number, dECODE (GROSS_ITEM_NAME , NULL,itm.attribute2,GROSS_ITEM_NAME ) item_description, subdtlest.ITEM_UOM unit_of_measurement, SUM ( subdtlest.QTY_ISSUE ) Quantity_Issue, sum(nvl (subdtlest.CALC_CEMENT_SK ,subdtlest.CALC_AMOUNT ) ) quantity , mst.DN_DESCRIPTION Description --decode(MST.DESCRIPTION ,NULL ,mst.DN_DESCRIPTION,MST.DESCRIPTION) Description from XXNP_OPN_JOBLOG_001 mst , XXNP_OPN_JOBLOG_STAGE_002 dtl , XXNP_OPN_JOBLOG_SLURRY_003 subdtl , XXNP_OPN_JOBLOG_EST_002 subdtlest, qp_list_lines_v line , QP_LIST_HEADERS_TL head , QP_LIST_HEADERS_B curr, ra_customers ra , AR_ADDRESSES_V v , MTL_SYSTEM_ITEMS itm where dtl.OPN_JOBLOG_001_ID = mst.OPN_JOBLOG_001_ID AND subdtl.OPN_JOBLOG_001_ID = dtl.OPN_JOBLOG_001_ID AND subdtl.OPN_JOBLOG_006_ID = dtl.OPN_JOBLOG_006_ID and subdtlest.OPN_JOBLOG_001_ID = subdtl.OPN_JOBLOG_001_ID AND subdtlest.OPN_JOBLOG_006_ID = subdtl.OPN_JOBLOG_006_ID AND subdtlest.OPN_JOBLOG_007_ID = subdtl.OPN_JOBLOG_007_ID AND line.LIST_HEADER_ID = head.LIST_HEADER_ID and curr.LIST_HEADER_ID = head.LIST_HEADER_ID and substr ( PRODUCT_ATTR_VAL_DISP , 1, instr ( PRODUCT_ATTR_VAL_DISP ,'.' )-1 ) = subdtlest.ITEM_NUMBER and itm.SEGMENT3 = substr ( PRODUCT_ATTR_VAL_DISP , INSTR(PRODUCT_ATTR_VAL_DISP, '.', -1, 1) + 1 ) and mst.CONTRACT = head.name and RA.CUSTOMER_ID = v.CUSTOMER_ID and ra.customer_id = mst.customer_id and V.ADDRESS1 = mst.CONTRACT and mst.OPN_JOB_DESC='K/D/UP24/UN006/KOP/PL/0112/1' and itm.ORGANIZATION_ID =103 and itm.INVENTORY_ITEM_STATUS_CODE = 'Active' group by mst.ENTRY_DATE , V.ADDRESS1 , OPN_JOB_DESC ,mst.FIELD, ra.CUSTOMER_NAME , substr ( PRODUCT_ATTR_VAL_DISP , INSTR(PRODUCT_ATTR_VAL_DISP, '.', -1, 1) + 1 ), itm.ATTRIBUTE2 , subdtlest.ITEM_UOM , mst.DN_DESCRIPTION ,GROSS_ITEM_REF ,GROSS_ITEM_NAME order by substr ( PRODUCT_ATTR_VAL_DISP , INSTR(PRODUCT_ATTR_VAL_DISP, '.', -1, 1) + 1 ) Asc i require a field called balance which is sum of Quantity_issue and Quantity fields
thanking in advancei tried this select mst.ENTRY_DATE ordered_date , mst.FIELD, V.ADDRESS1 Address , OPN_JOB_DESC job_number, ra.CUSTOMER_NAME customer_NAME, DECODE ( GROSS_ITEM_REF , NULL , SUBSTR (PRODUCT_ATTR_VAL_DISP , INSTR( PRODUCT_ATTR_VAL_DISP, '.', -1, 1) + 1 ) , GROSS_ITEM_REF ) item_number, dECODE (GROSS_ITEM_NAME , NULL,itm.attribute2,GROSS_ITEM_NAME ) item_description, subdtlest.ITEM_UOM unit_of_measurement, SUM ( subdtlest.QTY_ISSUE ) Quantity_Issue, sum(nvl (subdtlest.CALC_CEMENT_SK ,subdtlest.CALC_AMOUNT ) ) quantity , sum(sum(nvl (subdtlest.CALC_CEMENT_SK ,subdtlest.CALC_AMOUNT ) ) + SUM ( subdtlest.QTY_ISSUE ) )balance, mst.DN_DESCRIPTION Description --decode(MST.DESCRIPTION ,NULL ,mst.DN_DESCRIPTION,MST.DESCRIPTION) Description from XXNP_OPN_JOBLOG_001 mst , XXNP_OPN_JOBLOG_STAGE_002 dtl , XXNP_OPN_JOBLOG_SLURRY_003 subdtl , XXNP_OPN_JOBLOG_EST_002 subdtlest, qp_list_lines_v line , QP_LIST_HEADERS_TL head , QP_LIST_HEADERS_B curr, ra_customers ra , AR_ADDRESSES_V v , MTL_SYSTEM_ITEMS itm where dtl.OPN_JOBLOG_001_ID = mst.OPN_JOBLOG_001_ID AND subdtl.OPN_JOBLOG_001_ID = dtl.OPN_JOBLOG_001_ID AND subdtl.OPN_JOBLOG_006_ID = dtl.OPN_JOBLOG_006_ID and subdtlest.OPN_JOBLOG_001_ID = subdtl.OPN_JOBLOG_001_ID AND subdtlest.OPN_JOBLOG_006_ID = subdtl.OPN_JOBLOG_006_ID AND subdtlest.OPN_JOBLOG_007_ID = subdtl.OPN_JOBLOG_007_ID AND line.LIST_HEADER_ID = head.LIST_HEADER_ID and curr.LIST_HEADER_ID = head.LIST_HEADER_ID and substr ( PRODUCT_ATTR_VAL_DISP , 1, instr ( PRODUCT_ATTR_VAL_DISP ,'.' )-1 ) = subdtlest.ITEM_NUMBER and itm.SEGMENT3 = substr ( PRODUCT_ATTR_VAL_DISP , INSTR(PRODUCT_ATTR_VAL_DISP, '.', -1, 1) + 1 ) and mst.CONTRACT = head.name and RA.CUSTOMER_ID = v.CUSTOMER_ID and ra.customer_id = mst.customer_id and V.ADDRESS1 = mst.CONTRACT --and OPN_JOB_DESC = :P_JOB_NUMBER and itm.ORGANIZATION_ID =103 and itm.INVENTORY_ITEM_STATUS_CODE = 'Active' and mst.OPN_JOB_DESC='K/D/UP24/UN006/KOP/PL/0112/1' group by mst.ENTRY_DATE , V.ADDRESS1 , OPN_JOB_DESC ,mst.FIELD, ra.CUSTOMER_NAME , substr ( PRODUCT_ATTR_VAL_DISP , INSTR(PRODUCT_ATTR_VAL_DISP, '.', -1, 1) + 1 ), itm.ATTRIBUTE2 , subdtlest.ITEM_UOM , subdtlest.CALC_CEMENT_SK ,subdtlest.CALC_AMOUNT, subdtlest.QTY_ISSUE , mst.DN_DESCRIPTION ,GROSS_ITEM_REF ,GROSS_ITEM_NAME order by substr ( PRODUCT_ATTR_VAL_DISP , INSTR(PRODUCT_ATTR_VAL_DISP, '.', -1, 1) + 1 ) Asc but i get the cursor pointing to mst.entry_date and the message "not a single group function" kindly guide me
-
Not a "simple-group function.
SQL > select max(THREAD#), SEQUENCE #, NAME from v$ archived_log;
Select max(THREAD#), SEQUENCE #, NAME from v$ archived_log
*
ERROR on line 1:
ORA-00937: not a single group group function
Often, I face "not a single-group function. I tried with the order by clause, also,
-Please clarify why this error occurs?
Hello
You must use Group by clause in your query when you use the Group feature as count, sum, max in query
Select max(THREAD#), SEQUENCE #, NAME of Group v$ archived_log by SEQUENCE #, NAME;
Thank you
Su.GI
-
HELP to ' SQL error: ORA-00937: not a function of simple-group.
< p >
Hello world:
I have a forum based on oracle 11g database. There two tables: article of thread and the relationship between the two is "one-to-many.
I want to list the total number of seen of all the discussions in each section, and I write the sql code:
Select s.secname, sum (sum1) of join of s section
(select secid, sum1 sum (thrviewednum) of the Group of threads by secid) tt WE s.secid = tt.secid;
The 'secid' column is the pharmacokinetics of the section table and FK of the table of thread, the "thrviewednum" the number of views of a thread.
But I get the error:
Error in the command line: 1 column: 7
Error report:
SQL error: ORA-00937: not a function of simple-group
I can't understand the problem, could someone help me? Thank you.
< /p >Hello
Use this
Select s.secname, sum (sum1) of join of s section
(select secid, sum1 sum (thrviewednum) of the thread by secid group) THE group s.secid tt = tt.secid by s.secname;
This is because the select statement contains a column that is not part of any group function, so this column must be there in the group by clause
Concerning
-
How to display the column single line with function of nested groups
SQL > select deptno, Max (sum (sal)) SalSum
2 of PEM
3 Group of deptno;
Select deptno, Max (sum (sal)) SalSum
*
ERROR on line 1:
ORA-00937: not a single group group function
Can you please help me to get the Max (sum (sal)) with Deptno...Or:
select max(deptno) KEEP (DENSE_RANK LAST ORDER BY SalSum) deptno, max(SalSum) from ( select deptno,sum(sal) SalSum from emp group by deptno );
-
Help with error - 934 group function is not allowed here
Hey there will, I'm having problems with a request and just does not know how to do it without error.
I'm trying to get all the employee emerging infectious diseases that have less than 2 number max of DID (dependants) in the table.
It's my current query
SELECT Employee.LName. ' ' || Employee.Fname as Full_Name, Employee.EID
The left outer JOIN employee depends on Employee.EID = Dependent.EID
Having Count (DID)--2 > ((select Max (N) as From (SELECT Employee.EID, Count (DID) As N FROM Employee Inner Join Dependent On Employee.EID = Dependent.EID group by Employee.EID, Count (DID))) N)
Order of Employee.Lname, Employee.Fname
Which gives me an error on column 4, no matter what I do. If I remove the Count (DID) in the group by clause (which I tried it earlier), it gives me a is not an error of the function of single group...
The most frustrating thing is that
Select Max (N) as From (SELECT Employee.EID, Count (DID) As N FROM Employee Inner Join Dependent On Employee.EID = Dependent.EID group by Employee.EID) N
Works perfectly, but because it's a mission, I have to do in one step (no substeps/views)
Any help?
Thank you very much
Hello
ac981e5d-D10A-4520-BF42-23a894d04fb7 wrote:
Ok. I'm taking your code in a view... I get this.
and there is an orange underscore and a text of the error that says
Select incoherent list in group by... change the group by clause of e.fname, e.lname, e.eid, count, max
Which isn't what either the Oracle database would do. Everything about orange (or any other color) sounds like it is caused by a front-end that could be interacting with Oracle. In addition, the Oracle error messages always come with a 3-letter-5 code, as ORA-00933.
under the selection internal (first medium)
You have deleted the WITH clause. The parser can recognize the error when it has reached the first left parenthesis.
Create view AS A10T2
(
SELECT e.lname. ' ' || e.fname AS full_name
e.eid
(D.) AS this_group_count
MAX (COUNT (d.)) ON (AS highest_group_count)
E employee
LEFT OUTER JOIN dependent d ON e.eid = d.eid
GROUP BY e.lname, e.fname, e.eid
)
SELECT full_name
eid
Of aggregate_results
WHERE this_group_count > = highest_group_count - 2
ORDER BY full_name
You need the WITH to define this clause means "AGGREGATE_RESULTS":
Create view AS A10T2
WITH aggregate_results AS
(
SELECT e.lname. ' ' || e.fname AS full_name
...
Why do you have an ORDER BY clause in a view? (It is probably not cause of your errors, just make the inefficient view)
Command line error: column 5: 23
Error report-
SQL error: ORA-00933: SQL not correctly completed command
00933 00000 - "not correctly completed SQL command.
* Cause:
* Action:
This is another indication that some front is getting involved. Looks like your front-end reports the exact Oracle error message, "0RA-00933" and then builing it's own error code, "00933. 00000 ", on this basis. ORA-00933 is a reasonable mistake to wait if you omit the line ' WITH the aggregated results AS. Once again, until I can actually run your code, I can't test it, and I can't run your code until you post CREATE TABLE and INSERT statements for some examples of data, or change the problem to use commonly available tables, such as those in the scott schema.
and when I try my code
CREATE VIEW A10T2 AS
SELECT Employee.LName. ' ' || Employee.Fname as Full_Name, Employee.EID
The left outer JOIN employee depends on Employee.EID = Dependent.EID
Seen (Count (DID)) + 2 > (select Max (N) From (SELECT Employee.EID, Count (DID) As "N" FROM Employee Inner Join Dependent On Employee.EID = Dependent.EID group by Employee.EID))
Order of Employee.Lname, Employee.Fname
I get
Command line error: column 2: 8
Error report-
SQL error: ORA-00937: not a function of simple-group
00937 00000 - 'not a single-group function.
* Cause:
* Action:
Then the orange underscore even under my inner ("select employee. EID, Count (DID) as "N" ") says to change the Group of Employee.eid, Count (DID)
I just don't understand why he tells me to group them by Count (DID)?
Isn't that what you did in your original post, and I have explained in answer #2? If you continue to repeat the same mistake, you can expect continue to get the same error. Given that you have a code, you know causes an error, do you think really that what makes a vision will cause the error to disappear?
The inner query works fine on its own...
Right; It's the outer query where you are missing the GROUP BY clause.
-
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
-
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;
-
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
-
Since around seven 30 - Oct 1st or so I was unable to use all group functions in any group. 'Old' and those that I just created. I can't send or receive calls or messages in any group. I tried these steps below, and none of them worked. Help?
(1) sign out and back in
(2) change of profile information
(3) update the customer on the later (7.11.0.102)
(4) to uninstall and reinstall Skype
(5) clean uninstall and reinstall of Skype
(6) signature mobile to see if that will fix anything on the end of my PC
Mobile works very well, however my PC version does not. It worked very well in advance and then just suddenly stopped working for groups. Update the client did nothing. However, I can / message of appeal to people individually. I don't understand. I thought it was the linked server, but my friends have not had any problems...
Skype is based on some Windows Services work properly, or something?
I'm under 10 Home Windows (64-bit).
Welp, after scouring the net I found the problem. It turns out that my situation was the same as this post here.
-
not an expression GROUP BY - bug in Oracle 10 g?
Hello
I'm 00979. 00000 - "not a GROUP BY expression" error on Oracle 10g 10.2.0.4.0 - Production 64-bit.
To illustrate my problem, I have created following the example.
Think I have a shop with clothes. Whenever I sell something, I store this information in the database - storage in real time, type of clothing (pants, socks,...) and the size of the room (M, L, XL,...).
Now, the system account statistics every hour. So he's going thru the table with parts sold and counts the number of pieces by clothing type and size from the start of the day. It is important to realize that it is since the beginning of the day. For this reason, the number of pieces sold in the statistical table grows every hour (or is at least on the same value as in the previous hour).
Now, this table, I need to make new statistics. I want a statistic how many pieces by size, I sold every hour.
I created this application for this:
First I select the number of pieces sold by time and by size. To get the number of pieces sold for specific time, I need to subtract the value of number of pieces sold of the previous hour. I decided to do it with a parameter query.SELECT TIME, xSIZE, (SOLD - NVL((SELECT SUM(S1.SOLD) FROM STATISTICS S1 WHERE S1.xSIZE = S.xSIZE AND TRUNC(S1.TIME, 'HH24') + 1/24 = S.TIME AND TO_CHAR(S1.TIME, 'HH24') != '23' AND S1.xSIZE IS NOT NULL GROUP BY TRUNC(S1.TIME, 'HH24'), S1.xSIZE),0)) SOLD FROM( SELECT TRUNC(S.TIME, 'HH24') TIME, S.xSIZE, SUM(S.SOLD) SOLD FROM STATISTICS S WHERE S.xSIZE IS NOT NULL GROUP BY TRUNC(S.TIME, 'HH24'), S.xSIZE --ORDER BY 1 DESC ) S ORDER BY TIME DESC, xSIZE ASC
Runs the query like this I don't get "a GROUP BY expression" error. However, if I Uncomment 'ORDER BY DESC of 1' statement, the query works. I'm sure that he must do something with this line:
AND TRUNC (S1. TIME, 'HH24') + 1/24 = S.TIME
If you change the query like this:
Join the removed occasionally truncated tables and grouping truncated at the time--> the query does not lack...SELECT TIME, xSIZE, (SOLD - NVL((SELECT SUM(S1.SOLD) FROM STATISTICS S1 WHERE S1.xSIZE = S.xSIZE --AND TRUNC(S1.TIME, 'HH24') + 1/24 = S.TIME AND TO_CHAR(S1.TIME, 'HH24') != '23' AND S1.xSIZE IS NOT NULL GROUP BY S1.xSIZE),0)) SOLD FROM( SELECT TRUNC(S.TIME, 'HH24') TIME, S.xSIZE, SUM(S.SOLD) SOLD FROM STATISTICS S WHERE S.xSIZE IS NOT NULL GROUP BY TRUNC(S.TIME, 'HH24'), S.xSIZE --ORDER BY 1 DESC ) S ORDER BY TIME DESC, xSIZE ASC
And now the best... If you run the first query on Oracle 11 g (11.1.0.6.0 - 64 bit Production version), it works.
Anyone know why the first query does not work on 10g? Are there bugs and limitations for this version of server?
Please don't tell me to rewrite the query in a different way, I already did, to make it work on 10g more. I'm just curious as to why it does not work on 10g.
Finally, here are some data for the test.
Edited by: user12047225 the 20.9.2011 23:12CREATE TABLE STATISTICS( TIME DATE DEFAULT SYSDATE, TYPE VARCHAR2(20), xSIZE VARCHAR2(2), SOLD NUMBER(5,0) DEFAULT 0 ) INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 2/24, 'T-Shirt', 'M', 10); INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 2/24, 'Socks', 'M', 3); INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 2/24, 'T-Shirt', 'L', 1); INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 2/24, 'Socks', 'L', 50); INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 2/24, 'Trousers', 'XL', 7); INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 2/24, 'Socks', 'XL', 3); INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 1/24, 'T-Shirt', 'M', 13); INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 1/24, 'Socks', 'L', 60); INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 1/24, 'Trousers', 'XL', 15); INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 1/24, 'Socks', 'XL', 6);
Edited by: user12047225 the 20.9.2011 23:45This is a known issue when the optimizer decides to expand the online display. You can add something (outside of ORDER BY you already used) in online mode to prevent the optimizer from its expansion. For example:
SQL> SELECT TIME, 2 xSIZE, 3 (SOLD - NVL( 4 ( 5 SELECT SUM(S1.SOLD) 6 FROM STATISTICS S1 7 WHERE S1.xSIZE = S.xSIZE 8 AND TRUNC(S1.TIME, 'HH24') + 1/24 = S.TIME 9 AND TO_CHAR(S1.TIME, 'HH24') != '23' 10 AND S1.xSIZE IS NOT NULL 11 GROUP BY TRUNC(S1.TIME, 'HH24'), 12 S1.xSIZE 13 ), 14 0 15 ) 16 ) SOLD 17 FROM ( 18 SELECT TRUNC(S.TIME, 'HH24') TIME, 19 S.xSIZE, 20 SUM(S.SOLD) SOLD 21 FROM STATISTICS S 22 WHERE S.xSIZE IS NOT NULL 23 GROUP BY TRUNC(S.TIME, 'HH24'), 24 S.xSIZE 25 --ORDER BY 1 DESC 26 ) S 27 ORDER BY TIME DESC, 28 xSIZE ASC 29 / SELECT TRUNC(S.TIME, 'HH24') TIME, * ERROR at line 18: ORA-00979: not a GROUP BY expression SQL> SELECT TIME, 2 xSIZE, 3 (SOLD - NVL( 4 ( 5 SELECT SUM(S1.SOLD) 6 FROM STATISTICS S1 7 WHERE S1.xSIZE = S.xSIZE 8 AND TRUNC(S1.TIME, 'HH24') + 1/24 = S.TIME 9 AND TO_CHAR(S1.TIME, 'HH24') != '23' 10 AND S1.xSIZE IS NOT NULL 11 GROUP BY TRUNC(S1.TIME, 'HH24'), 12 S1.xSIZE 13 ), 14 0 15 ) 16 ) SOLD 17 FROM ( 18 SELECT TRUNC(S.TIME, 'HH24') TIME, 19 S.xSIZE, 20 SUM(S.SOLD) SOLD, 21 ROW_NUMBER() OVER(ORDER BY SUM(S.SOLD)) RN 22 FROM STATISTICS S 23 WHERE S.xSIZE IS NOT NULL 24 GROUP BY TRUNC(S.TIME, 'HH24'), 25 S.xSIZE 26 --ORDER BY 1 DESC 27 ) S 28 ORDER BY TIME DESC, 29 xSIZE ASC 30 / TIME XS SOLD --------- -- ---------- 20-SEP-11 L 9 20-SEP-11 M 0 20-SEP-11 XL 11 20-SEP-11 L 51 20-SEP-11 M 13 20-SEP-11 XL 10 6 rows selected. SQL>
Or use the subquery factoring (WITH clause) + undocumented hint of MATERIALIZATION:
SQL> WITH S AS ( 2 SELECT /*+ MATERIALIZE */ TRUNC(S.TIME, 'HH24') TIME, 3 S.xSIZE, 4 SUM(S.SOLD) SOLD 5 FROM STATISTICS S 6 WHERE S.xSIZE IS NOT NULL 7 GROUP BY TRUNC(S.TIME, 'HH24'), 8 S.xSIZE 9 --ORDER BY 1 DESC 10 ) 11 SELECT TIME, 12 xSIZE, 13 (SOLD - NVL( 14 ( 15 SELECT SUM(S1.SOLD) 16 FROM STATISTICS S1 17 WHERE S1.xSIZE = S.xSIZE 18 AND TRUNC(S1.TIME, 'HH24') + 1/24 = S.TIME 19 AND TO_CHAR(S1.TIME, 'HH24') != '23' 20 AND S1.xSIZE IS NOT NULL 21 GROUP BY TRUNC(S1.TIME, 'HH24'), 22 S1.xSIZE 23 ), 24 0 25 ) 26 ) SOLD 27 FROM S 28 ORDER BY TIME DESC, 29 xSIZE ASC 30 / TIME XS SOLD --------- -- ---------- 20-SEP-11 L 9 20-SEP-11 M 0 20-SEP-11 XL 11 20-SEP-11 L 51 20-SEP-11 M 13 20-SEP-11 XL 10 6 rows selected. SQL>
SY.
-
I would like to combine several orders and LEDs on the front panel in a group in a way that allows me to do the whole group Visible or not.
I tried to use a Cluster, but it has a side effect that all elements must be inside the controls or indicators, but not mixed.
Is there any graphic element, like a panel that can contain other controls and indicators on the inside and make them Visible or not as a group regardless of whether they are commands or the LEDs?
Good suggestions on how to do this?
Thank you.
The tab control is still not my favorite, appearance but it's a way fast and effective to show and hide groups of controls and indicators.
-
TMSPE Migration fails - could not create the Group
Hello
The performance of the Migration tool after installation TMSPE, I get 1 error warning and 1. From downstairs, it seems that {soul} is the problem here, but where can I change it with the recommended replacements? I see not {soul} anywhere in the model FindMe Provisioning or anywhere elsewhere in the TMS...
CAUTION:
Caller id model invalid for mycompany group could not migrated: [email protected] / * /. Legal replacement values are {mobile_phone} and {office_phone}.
ERROR:
Could not create the group for {display_name = [mycompany], display_name_pattern is [{display_name}], video_uri_pattern_inherited = [false], video_uri_pattern is [[email protected] / * /], device_uri_pattern = [[email protected] / * /], device_uri_pattern_inherited = [false]} URL: / groups the exception returned by the API was the argument
is the invalid state: Code of state InvalidArgument: 1005.
The exception message is: POST
http://localhost:8788/ur/groups returned a 400 Bad Request response status
Could not create the group for {display_name = [mycompany], display_name_pattern is [{display_name}], video_uri_pattern_inherited = [false], video_uri_pattern is [[email protected] / * /], device_uri_pattern = [[email protected] / * /], device_uri_pattern_inherited = [false]} URL: / groups the exception returned by the API was the argument
[email protected] / * / is the invalid state: Code of state InvalidArgument: 1005.
The exception message is: POST
http://localhost:8788/ur/groups returned a 400 Bad Request response status
Anyone can shed some light on this?
Thank you
Tom
You can try to remove the device uri scheme and the findme bosses and then try to make the migration again. If its success, you can re - fill these easy once tmspe is running.
/ Magnus
Sent by Cisco Support technique iPhone App
-
Where can I find the 2 stucco that comes with photoshop, is not in the group. Co
Where can I find the 2 stucco that comes with photoshop, is not in the group. Co
Hello
The model of stucco 2 should be in patterns of Texture Fill 2 .
-
I get these errors after updating, could you please review and advise.
Errors in the /d04/schval/product/10.2.0/admin/SCHVALS1/bdump/schvals1_j000_8224.trc file:
ORA-12012: error on auto work 2160513
ORA-06576: not a function or a procedure valid name
Sun 23 Jun 19:02:55 CDT 2013
Errors in the /d04/schval/product/10.2.0/admin/SCHVALS1/bdump/schvals1_j001_8463.trc file:
ORA-12012: error on auto work 2160514
ORA-06576: not a function or a procedure valid name
Sun 23 Jun 19:03:53 CDT 2013
Errors in the /d04/schval/product/10.2.0/admin/SCHVALS1/bdump/schvals1_j001_8463.trc file:
ORA-12012: error on auto work 2160514
ORA-06576: not a function or a procedure valid name
Sun 23 Jun 19:03:53 CDT 2013
Errors in the /d04/schval/product/10.2.0/admin/SCHVALS1/bdump/schvals1_j001_8463.trc file:
ORA-12012: error on auto work 2160513
ORA-06576: not a function or a procedure valid name
Sun 23 Jun 19:04:53 CDT 2013
Errors in the /d04/schval/product/10.2.0/admin/SCHVALS1/bdump/schvals1_j001_8463.trc file:
ORA-12012: error on auto work 2160514
ORA-06576: not a function or a procedure valid name
Sun 23 Jun 19:04:53 CDT 2013
Errors in the /d04/schval/product/10.2.0/admin/SCHVALS1/bdump/schvals1_j001_8463.trc file:
ORA-12012: error on auto work 2160513
ORA-06576: not a function or a procedure valid name
Checked the DB links are working properly
DB DB link: where I get these errors
SQL > select count (*) from [email protected] ;
COUNT (*)
----------
61233
the ERP DB
APPS-VAL1 > select count (*) from [email protected] ;
COUNT (*)
----------
439
If I try to run it manually, I am getting error below.
DBMS_SCHEDULER BEGIN. RUN_JOB ("SCHEDULE_REQUEST_DEQUEUE", TRUE); END;
*
ERROR on line 1:
"ORA-27475: ' XXSAP. SCHEDULE_REQUEST_DEQUEUE' must be work
ORA-06512: at "SYS." DBMS_ISCHED", line 150
ORA-06512: at "SYS." DBMS_SCHEDULER', line 441
ORA-06512: at line 1
SQL > SELECT master, job_name, error # FROM dba_scheduler_job_run_details
WHERE error # LIKE '% 6576% '; 2
OWNER
------------------------------
JOB_NAME
--------------------------------------------------------------------------------
ERROR #.
----------
SYS
SCHEDULING_LOCATION_UPDATE
6576
SYS
SCHEDULE_REQUEST_DEQUEUE
6576
OWNER
------------------------------
JOB_NAME
--------------------------------------------------------------------------------
ERROR #.
----------
SYS
SCHEDULE_REQUEST_DEQUEUE
6576
SQL > select job, what from dba_jobs where broken = 'Y' or chess > 0;
no selected line
LOG_DATE STATUS JOB_NAME
--------------------------------------------------------------------------- ------------------------------ ----------------------------------------
23 JUNE 13 11.37.53.128960 AM - 07:00 IS NOT SCHEDULING_NOTIFICATION_UPDATE
23 JUNE 13 11.37.54.619584 AM - 07:00 IS NOT SCHEDULE_REQUEST_DEQUEUE
23 JUNE 13 11.38.53.728264 AM - 07:00 IS NOT SCHEDULE_REQUEST_DEQUEUE
23 JUNE 13 11.39.53.830833 AM - 07:00 IS NOT SCHEDULE_REQUEST_DEQUEUE
23 JUNE 13 11.40.53.929791 AM - 07:00 IS NOT SCHEDULE_REQUEST_DEQUEUE
23 JUNE 13 11.41.54.047578 AM - 07:00 IS NOT SCHEDULE_REQUEST_DEQUEUE
23 JUNE 13 11.42.53.273320 AM - 07:00 IS NOT SCHEDULING_NOTIFICATION_UPDATE
23 JUNE 13 11.43.53.529692 AM - 07:00 IS NOT SCHEDULE_REQUEST_DEQUEUE
23 JUNE 13 11.44.53.628774 AM - 07:00 IS NOT SCHEDULE_REQUEST_DEQUEUE
23 JUNE 13 11.45.53.739038 AM - 07:00 IS NOT SCHEDULE_REQUEST_DEQUEUE
23 JUNE 13 11.46.53.848009 AM - 07:00 IS NOT SCHEDULE_REQUEST_DEQUEUE
LOG_DATE STATUS JOB_NAME
--------------------------------------------------------------------------- ------------------------------ ----------------------------------------
23 JUNE 13 11.47.57.220078 AM - 07:00 IS NOT SCHEDULE_REQUEST_DEQUEUE
23 JUNE 13 11.48.53.329549 AM - 07:00 IS NOT SCHEDULE_REQUEST_DEQUEUE
3324 selected lines.
SQL > 1
1 * Select log_date, status, JOB_NAME from dba_scheduler_job_run_details where status = 'in FAILURE. "
Thank you
Vincent
I suggest you to move (i.e. rebuild) jobs in the XXSAP scheme rather than use the SYS schema. In this way, you can run "BEGIN DBMS_SCHEDULER. RUN_JOB' to XXSAP correctly.
Hemant K Collette
Maybe you are looking for
-
Card of Qosmio F30-140 is scalable?
The Qosmio F30-140 comes with a Nvidia GeForce Go 7600 equipped factory.
-
not sure: the new hard drive installation
I have a Desktop allows a hard disk which is a failure. F9 during boot diagnostics say its bad. I just got the HP recovery disk and I'm not sure that 'when' to instaqll them. I put the OS on the new hard drive and then first run the recovery or re
-
How can JAWS says that media player inspects my files, I stop this?
JAWS screen reader When playing audio files in Media Player, then closing, JAWS mentions "inspection of files" then left at talk. Like a screen reader user blind, I'm worried, I relayed on this program. Is it a requirement to have my files inspected
-
clean install of windows XP to input signal out of range
Hi I recently took my old pc xp out of the dusty closet.I discovered that the operating system has been corrupted then decided to do a clean install of windows xp.However after that it says press any key to boot from the disk and I press a button, th
-
Can someone tell where I can by the underside of cable other than part - people.com. Sound is not available at this time. www.Parts-People.com/index.php; ID = 17338