ora-00979

ORA-00979: not a GROUP BY expression [duplicate]

梦想与她 提交于 2019-12-24 14:24:22
问题 This question already has answers here : ORA-00979 not a group by expression (8 answers) Closed 5 years ago . Why does this work SELECT DISTINCT FIRSTNAME, LASTNAME FROM books, CUSTOMERS, orders, orderitems WHERE STATE IN('FL ', 'GA') GROUP BY orders.order#, firstname, lastname HAVING SUM(retail*quantity) > 80 but when firstname, lastname is removed from group by it doesn't? ORA-00979: not a GROUP BY expression 回答1: In that case where firstname, lastname are removed from the group by , you

ORA-00979: not a GROUP BY expression issue [duplicate]

两盒软妹~` 提交于 2019-12-24 03:46:11
问题 This question already has answers here : ORA-00979 not a group by expression (8 answers) Closed 5 years ago . I am performing the following request and I get a "ORA-00979: not a GROUP BY expression" error. select distinct field1, field2, field3, count(*) as field4, field5, field6, case when smt1>0 then 'Deleted' when smt2>0 then 'Impacted' when smt3>0 then 'Unknown' else 'Clean' end as field7, field8, field9, field10, field11, field12, field13 from (<here a big sub query>) A group by field1,

Grails groupProperty and order. How it works?

大城市里の小女人 提交于 2019-12-05 14:28:24
I have this domain : class Participation { ParticipationStatus status } class ParticipationStatus{ String name Date creationDate } I create a query : Participation.createCriteria().list{ createAlias("status","statusAlias") order "statusAlias.creationDate" projections{ groupProperty "id" } } But I received an error : Caused by: java.sql.SQLException: ORA-00979: N'est pas une expression GROUP BY I 'm working 2 days ago on this query grrrr ! ;-) Thanks a lot Every field you use in aggregate queries (the one using projections ) should be either a groupProperty , or only an aggregate function

oracle sql not a group by expression while counting [duplicate]

坚强是说给别人听的谎言 提交于 2019-12-02 10:49:55
问题 This question already has answers here : ORA-00979 not a group by expression (8 answers) Closed 5 years ago . i'm trying to run the following query that counts the number of doctors with patient referrals within the last 6 months: SELECT count(local_doc.providerno) NumberofReferals, LOCAL_DOC.FULLNAME FULLNAME, LOCAL_DOC.TELNUMBER TELNUMBER, LOCAL_DOC.STREET STREET, LOCAL_DOC.SUBURB SUBURB, LOCAL_DOC.STATE STATE, LOCAL_DOC.POSTCODE POSTCODE, LOCAL_DOC.PROVIDERNO FROM LOCAL_DOC, PATIENT WHERE

oracle sql not a group by expression while counting [duplicate]

北战南征 提交于 2019-12-02 06:21:18
This question already has an answer here: ORA-00979 not a group by expression 8 answers i'm trying to run the following query that counts the number of doctors with patient referrals within the last 6 months: SELECT count(local_doc.providerno) NumberofReferals, LOCAL_DOC.FULLNAME FULLNAME, LOCAL_DOC.TELNUMBER TELNUMBER, LOCAL_DOC.STREET STREET, LOCAL_DOC.SUBURB SUBURB, LOCAL_DOC.STATE STATE, LOCAL_DOC.POSTCODE POSTCODE, LOCAL_DOC.PROVIDERNO FROM LOCAL_DOC, PATIENT WHERE PATIENT.PROVIDERNO = LOCAL_DOC.PROVIDERNO AND PATIENT.REFERALDATE <= sysdate AND PATIENT.REFERALDATE >= ADD_MONTHS(sysdate,

Oracle ORA-00979 - “not a GROUP BY expression”

爷,独闯天下 提交于 2019-11-28 14:22:29
Can anybody please help me with this particular query? I'm having ORA-00979 when trying to run this: select t0.title, count (1) as count0, (select count (1) from contract c1, se se1 where c1.c_id = se1.c_id and se1.svc_id = 3 and se1.deleted = 0 and c1.deleted = 0 and c1.c_date between to_date ('07.10.2000', 'dd.mm.yyyy') and to_date ('22.11.2010', 'dd.mm.yyyy') and c1.company = 0 and c1.tdata.tariff = c0.tdata.tariff ) as count1 from contract c0, se se0, tariff t0 where c0.c_id = se0.c_id and se0.svc_id = 3 and se0.deleted = 0 and c0.deleted = 0 and c0.c_date between to_date ('21.11.2000',

Oracle ORA-00979 - “not a GROUP BY expression”

一个人想着一个人 提交于 2019-11-27 08:29:25
问题 Can anybody please help me with this particular query? I'm having ORA-00979 when trying to run this: select t0.title, count (1) as count0, (select count (1) from contract c1, se se1 where c1.c_id = se1.c_id and se1.svc_id = 3 and se1.deleted = 0 and c1.deleted = 0 and c1.c_date between to_date ('07.10.2000', 'dd.mm.yyyy') and to_date ('22.11.2010', 'dd.mm.yyyy') and c1.company = 0 and c1.tdata.tariff = c0.tdata.tariff ) as count1 from contract c0, se se0, tariff t0 where c0.c_id = se0.c_id

GROUP BY with MAX(DATE) [duplicate]

非 Y 不嫁゛ 提交于 2019-11-26 00:17:34
问题 This question already has answers here : Fetch the row which has the Max value for a column (34 answers) Closed 2 years ago . I\'m trying to list the latest destination (MAX departure time) for each train in a table, for example: Train Dest Time 1 HK 10:00 1 SH 12:00 1 SZ 14:00 2 HK 13:00 2 SH 09:00 2 SZ 07:00 The desired result should be: Train Dest Time 1 SZ 14:00 2 HK 13:00 I have tried using SELECT Train, Dest, MAX(Time) FROM TrainTable GROUP BY Train by I got a \"ora-00979 not a GROUP BY

ORA-00979 not a group by expression

谁说我不能喝 提交于 2019-11-25 21:38:02
问题 I am getting ORA-00979 with the following query: SELECT cr.review_sk, cr.cs_sk, cr.full_name, tolist(to_char(cf.fact_date, \'mm/dd/yyyy\')) \"appt\", cs.cs_id, cr.tracking_number from review cr, cs, fact cf where cr.cs_sk = cs.cs_sk and UPPER(cs.cs_id) like \'%\' || UPPER(i_cs_id) || \'%\' and row_delete_date_time is null and cr.review_sk = cf.review_wk (+) and cr.fact_type_code (+) = 183050 GROUP BY cr.review_sk, cr.cs_sk, cf.fact_date, cr.tracking_number ORDER BY cs.cs_id, cr.full_name; I