HAVING clause error in JPA 2 examples

In Chapter 8: Query Language of the Pro JPA 2 Mastering the Java Persistence API book, the jpqlExamples WAR has this query:
SELECT e, COUNT(p)
FROM Employee e JOIN e.projects p
GROUP BY e
HAVING COUNT(p) >= 2
When executed, the following error occurs:
java.lang.IllegalArgumentException: An exception occurred while creating a query in EntityManager:
Exception Description: Error compiling the query [SELECT e, COUNT(p) FROM Employee e JOIN e.projects p GROUP BY e HAVING COUNT(p) >= 2], line 1, column 80: invalid HAVING expression [COUNT(p) >= 2] for query with grouping [GROUP BY e]. The HAVING clause must specify search conditions over the grouping items or aggregate functions that apply to grouping items.
I bring this us because I have an application which is getting the same error and need a fix. If the query is indeed legal in JPA 2, then why the error? If if it is my setup however, then I would like suggestions on fixing it. I am using GlassFish v3 (build 74.2), updated regularly with the Update Tool.

The bug has been reopened. Now it says:
Reopening because there is some debate about whether this should be supported
by the spec. Some people read the spec to say the above query is allowed - I
am not convinced, but discussion can be appended to this bug if necessary.
This is Bug 308482, and I assume at least a few might want to take a look.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=308482

Similar Messages

  • Using column aliases in having clause error

    This is the query I'm trying to run.
    select concat(concat(student.last_name, ', '), student.first_name) student, count(school_apply.decision) decision
    from student, school_apply
    where student.student_id = school_apply.student_id
    and school_apply.decision = 'accepted'
    having decision < 3
    group by student.last_name, student.first_name
    order by count(school_apply.decision) desc, student.last_name, student.first_name;
    I got the following error
    Error at Command Line:5 Column:7
    Error report:
    SQL Error: ORA-00979: not a GROUP BY expression
    00979. 00000 - "not a GROUP BY expression"
    if in the having I use count(school_apply.decision) instead of the alias, it works fine. Why is this? and how can I use the alias'd column in the SQL?

    Hi,
    user4038196 wrote:
    This is the query I'm trying to run.
    select concat(concat(student.last_name, ', '), student.first_name) student, count(school_apply.decision) decision
    from student, school_apply
    where student.student_id = school_apply.student_id
    and school_apply.decision = 'accepted'
    having decision < 3
    group by student.last_name, student.first_name
    order by count(school_apply.decision) desc, student.last_name, student.first_name;
    I got the following error
    Error at Command Line:5 Column:7
    Error report:
    SQL Error: ORA-00979: not a GROUP BY expression
    00979. 00000 - "not a GROUP BY expression"
    if in the having I use count(school_apply.decision) instead of the alias, it works fine. Why is this? and how can I use the alias'd column in the SQL?When you define a column alias, like decision, in a query, you can use it in the ORDER BY clause. That's the only place in that query where you can use it.
    You can always assign the alias in a sub-query, then use it anywhere you want to in a super-query, like this:
    WITH     got_aggregates     AS
         select   student.last_name || ', '
                                  || student.first_name     AS student
         ,        count (school_apply.decision)           AS decision
         from       student
         ,       school_apply
         where        student.student_id     = school_apply.student_id
         and       school_apply.decision = 'accepted'
         group by  student.last_name
         ,            student.first_name
    SELECT    *
    FROM       got_aggregates
    WHERE       decision     < 3          -- Okay to use alias from sub-query
    ORDER BY  decision     DESC          -- Okay to use alias from sub-query
    ,            student               -- Okay to use alias from sub-query
    ;

  • HAVING clause, or ORDER BY clause ....ERROR

    hi i have following query which throws error plz find the solution for the query to go safe..
    Select C.src_cd,
    D.src_nm,
    count(*) supp_clm_count,
    (CASE WHEN A.clm_ttladjamt > 0 then A.clm_ttladjamt else A.clm_ttlreqamt END) as amount
    From IWOWNER.WC_clm A,
    IWOWNER.WC_clm_srvc B,
    SHOWNER.WC_SRC C,
    SHOWNER.WC_SRC_lang D
    where A.clm_id = B.clm_id
    and A.rcv_loc_id = C.src_id
    and C.src_id = D.src_id
    and TRANSLATE(A.clm_rqst_type_cd) = 'SUPPLIERCLAIM'
    and TRANSLATE(A.clm_typ_cd) in ('WARRANTY','PRE-DELIVERY')
    and DATE(A.clm_create_dt) between '01/01/2000' and '01/01/2010'
    Group by C.src_cd, D.src_nm
    ERROR:
    SQLSTATE: 42803, SQLERRMC: CLM_TTLADJAMT
    Message: An expression starting with "CLM_TTLADJAMT" specified in a SELECT clause, HAVING clause, or ORDER BY clause is not specified in the GROUP BY clause or it is in a SELECT clause, HAVING clause, or ORDER BY clause with a column function and no GROUP BY clause is specified

    Hi,
    With analytic function
    /* Formatted on 2009/07/22 10:47 (Formatter Plus v4.8.8) */
    SELECT DISTINCT c.src_cd, d.src_nm,
                    COUNT (1) OVER (PARTITION BY c.src_cd, d.src_nm)
                                                                   supp_clm_count,
                    SUM (CASE
                            WHEN a.clm_ttladjamt > 0
                               THEN a.clm_ttladjamt
                            ELSE a.clm_ttlreqamt
                         END
                        ) OVER (PARTITION BY c.src_cd, d.src_nm) AS amount
               FROM iwowner.wc_clm a,
                    iwowner.wc_clm_srvc b,
                    showner.wc_src c,
                    showner.wc_src_lang d
              WHERE a.clm_id = b.clm_id
                AND a.rcv_loc_id = c.src_id
                AND c.src_id = d.src_id
                AND a.clm_rqst_type_cd = 'SUPPLIERCLAIM'
                AND a.clm_typ_cd IN ('WARRANTY', 'PRE-DELIVERY')
                AND a.clm_create_dt BETWEEN TO_DATE ('01/01/2000', 'dd/mm/yyyy')
                                        AND TO_DATE ('01/01/2010', 'dd/mm/yyyy')

  • Group by clause and having clause in select

    hi frnds
    plz give me some information of group by and having clause used in select statement with example
    thanks

    The Open SQL statement for reading data from database tables is:
    SELECT      <result>
      INTO      <target>
      FROM      <source>
      [WHERE    <condition>]
      [GROUP BY <fields>]
      [HAVING   <cond>]
      [ORDER BY <fields>].
    The SELECT statement is divided into a series of simple clauses, each of which has a different part to play in selecting, placing, and arranging the data from the database.
    You can only use the HAVING clause in conjunction with the GROUP BY clause.
    To select line groups, use:
    SELECT <lines> <s1> [AS <a1>] <s2> [AS <a2>] ...
                   <agg> <sm> [AS <am>] <agg> <sn> [AS <an>] ...
           GROUP BY <s1> <s2> ....
           HAVING <cond>.
    The conditions <cond> that you can use in the HAVING clause are the same as those in the SELECT clause, with the restrictions that you can only use columns from the SELECT clause, and not all of the columns from the database tables in the FROM clause. If you use an invalid column, a runtime error results.
    On the other hand, you can enter aggregate expressions for all columns read from the database table that do not appear in the GROUP BY clause. This means that you can use aggregate expressions, even if they do not appear in the SELECT clause. You cannot use aggregate expressions in the conditions in the WHERE clause.
    As in the WHERE clause, you can specify the conditions in the HAVING clause as the contents of an internal table with line type C and length 72.
    Example
    DATA WA TYPE SFLIGHT.
    SELECT   CONNID
    INTO     WA-CONNID
    FROM     SFLIGHT
    WHERE    CARRID = 'LH'
    GROUP BY CONNID
    HAVING   SUM( SEATSOCC ) > 300.
      WRITE: / WA-CARRID, WA-CONNID.
    ENDSELECT.
    This example selects groups of lines from database table SFLIGHT with the value ‘LH’ for CARRID and identical values of CONNID. The groups are then restricted further by the condition that the sum of the contents of the column SEATSOCC for a group must be greater than 300.
    The <b>GROUP BY</b> clause summarizes several lines from the database table into a single line of the selection.
    The GROUP BY clause allows you to summarize lines that have the same content in particular columns. Aggregate functions are applied to the other columns. You can specify the columns in the GROUP BY clause either statically or dynamically.
    Specifying Columns Statically
    To specify the columns in the GROUP BY clause statically, use:
    SELECT <lines> <s1> [AS <a 1>] <s 2> [AS <a 2>] ...
                   <agg> <sm> [AS <a m>] <agg> <s n> [AS <a n>] ...
           GROUP BY <s1> <s 2> ....
    To use the GROUP BY clause, you must specify all of the relevant columns in the SELECT clause. In the GROUP BY clause, you list the field names of the columns whose contents must be the same. You can only use the field names as they appear in the database table. Alias names from the SELECT clause are not allowed.
    All columns of the SELECT clause that are not listed in the GROUP BY clause must be included in aggregate functions. This defines how the contents of these columns is calculated when the lines are summarized.
    Specifying Columns Dynamically
    To specify the columns in the GROUP BY clause dynamically, use:
    ... GROUP BY (<itab>) ...
    where <itab> is an internal table with line type C and maximum length 72 characters containing the column names <s 1 > <s 2 > .....
    Example
    DATA: CARRID TYPE SFLIGHT-CARRID,
          MINIMUM TYPE P DECIMALS 2,
          MAXIMUM TYPE P DECIMALS 2.
    SELECT   CARRID MIN( PRICE ) MAX( PRICE )
    INTO     (CARRID, MINIMUM, MAXIMUM)
    FROM     SFLIGHT
    GROUP BY CARRID.
      WRITE: / CARRID, MINIMUM, MAXIMUM.
    ENDSELECT.
    regards
    vinod

  • Why Scalar Subquery expression cannot be used in HAVING clauses?

    Hi All,
    I'm new to SQL. I'm confused with Scalar Subquery.
    Is there anyone who can answer me why Scalar Subquery expression cannot be used in HAVING clauses.
    Can you show me a example?
    Thanks very much,
    Xianyi.Ye
    Edited by: 908428 on 2012-1-16 下午7:24

    Hi,
    908428 wrote:
    Hi Frank,
    Thank you for your quick reply. I also agree with your point.
    But when I read the book, "OCA Oracle Database SQL Certified Expert Exam Guide",( link to illegal copies of book removed by moderator )
    on Page 359, it said that
    Scalar subquery expressions cannot be used in the following locations:
    1. In CHECK constraints
    2. In GROUP BY clauses
    3. In HAVING clauses
    4. In a function-based index (which is coming up in Chapter 11)
    5. As a DEFAULT value for a column
    6. In the RETURNING clause of any DML statement
    7. In the WHEN conditions of CASE
    8. In the START WITH and CONNECT BY clauses, which we discuss in
    Chapter 16.7 and 8 are wrong. Scalar sub-queries can be used in WHEN conditions and START WITH and CONNECT BY clauses. (At least in Oracle 10.2. Is the book based on some earlier version?)
    Edited by: BluShadow on 17-Jan-2012 09:08

  • Urgent Group by Having Clause Fails in Oracle and Works in Sybase

    Hello EveryBody I need to select curve data of curve whose date is maximum in that curve so say if i ahve
    so if records are
    curveid curvename curvedate
    1001 test1 12/12/1003
    1001 test1 12/13/1003
    1002 test2 12/12/2002
    1002 test2 12/12/2004
    I have query which run well in sybase but oracle screw up...My logic say having clause is use to filter the records of group so it should have worked in oracle.....
    Here is query
    select curveid,curvename from curve group by curveid having curvedate =max(curve_date)
    This give "not a Group by " error in oracle....It work well in sybase...
    ORA-00979: not a GROUP BY expression
    I have query which use subquery to select these records but i don't want that to use that query
    Please help

    please understand what I need the result
    for each curve i need that data of that curve who date is max in that curve group
    so say for 1001 there are two date 1/1/2001 and 1/1/2002
    I need the data of curve 1001 with date 1/1/2002
    Oracle should have some alternative solution for this....
    If i have to use subquery I do have subquery
    select a.curveid, b.curvename from curve a group by curveid having curvedate = (select max(curvedate) from curve where a.curveid=b.curveid group by curveid );
    I don't want to use that ,,,
    I want to solve my probelm using having and group/....
    Main purpose of having is to filter the records from group result so IT SHOULD DO THAT WHY ORACLE GIVE ORA ERROR FOR
    group by curve_id having curve_date=max(curve_date)
    Creators of oracle please reply

  • Use of Where and having clause

    Hi all,
    I always have a doubt about use of HAVING and WHERE clause,
    suppose I have table T1 with only one column C1
    CREATE TABLE T1
    (C1 VARCHAR2(1) );
    which having data by following INSERT scripts
    INSERT INTO T1 VALUES('A');
    INSERT INTO T1 VALUES('B');
    INSERT INTO T1 VALUES('C');
    INSERT INTO T1 VALUES('A');
    INSERT INTO T1 VALUES('B');
    INSERT INTO T1 VALUES('A');
    Now I want result as follows
    C1 ==== COUNT(C1)
    ==============
    B ===== 2
    A ===== 3
    So out of query 1 and 2 which approach is right ?
    1) SELECT C1,COUNT(C1) FROM T1
    WHERE C1<>'C'
    GROUP BY C1
    ORDER BY C1 DESC;
    2) SELECT C1,COUNT(C1) FROM T1
    GROUP BY C1
    HAVING C1<>'C'
    ORDER BY C1 DESC;
    Edited by: user13306874 on Jun 21, 2010 2:36 AM

    In SQL, it's always best to filter data at the earliest moment possible.
    In your example the WHERE clause would be that moment:
    SQL> explain plan for
      2  select c1,count(c1)
      3  from t1
      4  where c1 != 'C'
      5  group by c1
      6* order by c1 desc;
    Explained.
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 3946799371
    | Id  | Operation          | Name | Rows  | Bytes |
    |   0 | SELECT STATEMENT   |      |     5 |    10 |
    |   1 |  SORT GROUP BY     |      |     5 |    10 |
    |*  2 |   TABLE ACCESS FULL| T1   |     5 |    10 |
    Predicate Information (identified by operation id):
       2 - filter("C1"!='C')
    18 rows selected.
    SQL>As you can see the filter is applied during the scan of T1.
    Whereas in the HAVING case:
    SQL> explain plan for
      2  select c1,count(c1)
      3  from t1
      4  group by c1
      5  having c1 != 'C'
      6* order by c1 desc;
    Explained.
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 3146800528
    | Id  | Operation           | Name | Rows  | Bytes |
    |   0 | SELECT STATEMENT    |      |     6 |    12 |
    |*  1 |  FILTER             |      |       |       |
    |   2 |   SORT GROUP BY     |      |     6 |    12 |
    |   3 |    TABLE ACCESS FULL| T1   |     6 |    12 |
    Predicate Information (identified by operation id):
       1 - filter("C1"!='C')
    18 rows selected.
    SQL>The scan is done after all groups have been computed: one of which was computed in vain, since it will be filtered away due to the HAVING clause.
    In general I would use as a guideline: if you are not using aggregate functions in your HAVING clause predicate, then move that predicate to the WHERE portion of your query.
    Edited by: Toon Koppelaars on Jun 21, 2010 11:54 AM

  • Use of group by and having clause

    hi frnds
    can anybody explain me the use of group by an having clause in select state ment

    Hi Rohit,
    1. GROUP BY f1 ... fn
    2. GROUP BY (itab)
    1. GROUP BY f1 ... fn
    Effect
    Groups database table data in a SELECT command on one line in the result set. A group is a set of lines which all have the same values in each column determined by the field descriptors f1 ... fn.
    ... GROUP BY f1 ... fn always requires a list in the SELECT clause. If you use field descriptors without an aggregate funciton in the SELECT clause, you must list them in the GROUP BY f1 ... fn clause.
    Example
    Output the number of passengers, the total weight and the average weight of luggage for all Lufthansa flights on 28.02.1995:
    TABLES SBOOK.
    DATA:  COUNT TYPE I, SUM TYPE P DECIMALS 2, AVG TYPE F.
    DATA:  CONNID LIKE SBOOK-CONNID.
    SELECT CONNID COUNT( * ) SUM( LUGGWEIGHT ) AVG( LUGGWEIGHT )
           INTO (CONNID, COUNT, SUM, AVG)
           FROM SBOOK
           WHERE
             CARRID   = 'LH'       AND
             FLDATE   = '19950228'
           GROUP BY CONNID.
      WRITE: / CONNID, COUNT, SUM, AVG.
    ENDSELECT.
    Note
    ... GROUP BY f1 ... fn is not supported for pooled and cluster tables.
    2. GROUP BY (itab)
    Effect
    Works like GROUP BY f1 ... fn if the internal table itab contains the list f1 ... fn as ABAP source code. The internal table itab can only have one field. This field must be of the type C and should not be more than 72 characters long. itab must be enclosed in parentheses and there should be no blanks between the parentheses and the table name.
    Note
    The same restrictions apply to this variant as to GROUP BY f1 ... fn.
    Example
    Output all Lufthansa departure points with the number of destinations:
    TABLES: SPFLI.
    DATA:   BEGIN OF WA.
              INCLUDE STRUCTURE SPFLI.
    DATA:     COUNT TYPE I.
    DATA:   END OF WA.
    DATA:   WA_TAB(72) TYPE C,
            GTAB LIKE TABLE OF WA_TAB,
            FTAB LIKE TABLE OF WA_TAB,
            COUNT TYPE I.
    CLEAR: GTAB, FTAB.
    WA_TAB = 'COTYFROM COUNT( * ) AS COUNT'. APPEND FTAB.
    APPEND WA_TAB TO FTAB.
    WA_TAB = 'CITYFROM'.
    APPEND WA_TAB TO GTAB.
    SELECT DISTINCT (FTAB)
           INTO CORRESPONDING FIELDS OF WA
           FROM SPFLI
           WHERE
             CARRID   = 'LH'
           GROUP BY (GTAB).
      WRITE: / WA-CITYFROM, WA-COUNT.
    ENDSELECT.
    Regards,
    Susmitha

  • Having clause with Analytic function

    can you pls let me know if we can use HAVING clause with analytic function
    select eid,empno,sum(sal) over(partition by year)
    from employee
    where dept = 'SALES'
    having sum(sal) > 10000I m getting error while using the above,
    IS that we can use HAVING clause with partition by
    Thanks in advance

    Your having clause isn't using an analytical function, is using a regular aggregate function.
    You also can't use analytical functions in the where clause or having clause like that as they are windowing functions and belong at the top of the query.
    You would have to wrap the query to achieve what you want e.g.
    SQL> ed
    Wrote file afiedt.buf
      1  select deptno, total_sal
      2  from (
      3        select deptno,sum(sal) over (partition by deptno) as total_sal
      4        from   emp
      5       )
      6  group by deptno, total_sal
      7* having total_sal > 10000
    SQL> /
        DEPTNO  TOTAL_SAL
            20      10875
    SQL>

  • Group By -- Having Clause related doubt.

    Hello,
    Can we Write/Use rather a 'Having Condition' Before a Group by Clause ..?
    If Yes then How does it Work.. I mean a 'Having' is a WHERE clause (filter) on Aggregate results ...
    SO how does Having works before grouping the Results..??

    Hi,
    Aijaz Mallick wrote:
    Hello,
    Can we Write/Use rather a 'Having Condition' Before a Group by Clause ..?What happens when you try it?
    If Yes then How does it Work.. I mean a 'Having' is a WHERE clause (filter) on Aggregate results ... Right; the HAVING clause is like another WHERE clause.
    The WHERE clause is applied before the GROUP BY is done, and the aggregate functions are computed.
    The HAVING clause is applied after the GROUP BY is done, and the aggregate functions are computed, so you can use aggregate functions in the HAVING clause.
    SO how does Having works before grouping the Results..??The order in which clauses appear in your code isn't necessarily the order in which they are performed. For example,
    SELECT    job
    ,         COUNT (*)  AS cnt
    FROM      scott.emp
    GROUP BY  job;Does it confuse you that this query can reference COUNT (*) in the SLECT clause, which is before the GROUP BY clause?
    The SELECT clause which always comes before the GROUP BY clause in code. That does not mean that the SELECT clause is completed before the GROUP BY clause is begun.
    If the documentation says that clauses must be in a certain order, then use that order, even if your current version of Oracle allows them to be in a different order. There's no guarantee that the next version of Oracle will allow something that was always said to be wrong.

  • Subquery in the HAVING Clause

    Hello all,
    i'm getting error when i try to write sub query in having clause. check out my query
    select  ROUND( Count( distinct  Sales2011_DIVDPTA.DIVDPTA_Item_Dept ),0)  AS  "F1" , ROUND( Count( Sales2011.Sales2011_DG1.Item_Season ),0)  AS  "F2"  
    from Sales2011.Sales2011_JT    
      INNER JOIN Sales2011.Sales2011_DG1 On Sales2011.Sales2011_DG1.DG1_ID =Sales2011.Sales2011_JT.DG1_ID   
    LEFT JOIN Sales2011.Sales2011_DIVDPTA On nvl(Sales2011.Sales2011_DIVDPTA.DIVDPTA_ITEM_DIVISION,' ')=nvl(Sales2011.Sales2011_DG1.Item_Division,' ')
      AND  nvl(Sales2011.Sales2011_DIVDPTA.DIVDPTA_ITEM_DEPT,' ')=nvl(Sales2011.Sales2011_DG1.Item_Dept,' ')       
    having ( ROUND( Count( Sales2011.Sales2011_DG1.Item_Season ),0)     in ( 0)
    But it is not executed if I use the sub query in having clause
    select  ROUND( Count( distinct  Sales2011_DIVDPTA.DIVDPTA_Item_Dept ),0)  AS  "F1" ,  ROUND( Count( Sales2011.Sales2011_DG1.Item_Season ),0)  AS  "F2"   
    from Sales2011.Sales2011_JT       
    INNER JOIN Sales2011.Sales2011_DG1 On Sales2011.Sales2011_DG1.DG1_ID =Sales2011.Sales2011_JT.DG1_ID   
    LEFT JOIN Sales2011.Sales2011_DIVDPTA On nvl(Sales2011.Sales2011_DIVDPTA.DIVDPTA_ITEM_DIVISION,' ')=nvl(Sales2011.Sales2011_DG1.Item_Division,' ')
    AND  nvl(Sales2011.Sales2011_DIVDPTA.DIVDPTA_ITEM_DEPT,' ')=nvl(Sales2011.Sales2011_DG1.Item_Dept,' ')        
    having ( ROUND( Count( Sales2011.Sales2011_DG1.Item_Season ),0)
    in ( select   ROUND( Count(
    Sales2011.Sales2011_DG1.Item_Season ),0)  from    Sales2011.Sales2011_DG1 )
    Error at Command Line:1 Column:0
    Error report:
    SQL Error: ORA-00979: not a GROUP BY expression
    00979. 00000 -  "not a GROUP BY expression"
    *Cause:   
    *Action:any help ???

    Sorry unintentionally i have posted my question here.
    will you please elaborate this? Becoz i'm not using group by clause in both query. First query run successfully but as i put sub query in having clause it raised an error. will you tell where i'm committing mistake?
    Aggregates in the HAVING clause do not need to appear in the SELECT list. If the HAVING clause contains a subquery, the subquery can refer to the outer query block if and only if it refers to a grouping column.Edited by: Oracle Studnet on Aug 14, 2011 11:28 PM

  • Where or Having clause and COUNT(1)

    I'm having trouble trying to figure out the way to get the conditional difference between two counts in a where clause.
    I would like to scan a table and only select records where the record count of one column attribute is different than another.
    I have
    select name, count(1) from skill <<< TOTAL_COUNT
    and
    select name, count(1) from skill where score is not NULL <<<< SCORED_COUNT
    I want to have a statement that just returns the names for those where TOTAL_COUNT - SCORED_COUNT = 0
    ... meaning those names where any of the rows have not been scored.
    I've tried a "having clause" but it still returns all there names. Even those there TOTAL_COUNT - SCORED_COUNT > 0
    Here's the non-working code....
    select * from
    (select full_name
    from emp e
    where e.manager = 'Smith, John'
    having
    ((select count(1)
    from emp_skill es
    where es.emp_fk = e.id
    group by null) -
    (select count(1)
    from emp_skill es1
    where es1.emp_fk = e.id and
    es1.self_prof is not NULL
    group by null)) = 0
    )

    Don't take 3360 too seriously in this context. COUNT(expression) is a bit of a running joke around these parts.
    However, his response does contain the seed of the solution for your problem.
    COUNT(<expression>) works because the COUNT function counts all rows with a non-null value for expression. So COUNT('Chocula') counts the non-null occurences of the literal string 'Chocula' in the table. Obviously, this counts every row in the table. COUNT(*) counts all the non-null occurences of a row in the table (even a row with all null values is a row). Clearly these are equivalent.
    However, if <expression> evaluates differently for each row, then COUNT(*) and COUNT(<expression>) can differ. So, for your example, assuming that the scored column is truly NULL in some records, what you need is something like:
    SQL> SELECT * FROM skill;
    NAME            SCORE
    BOB                 5
    BOB                 6
    BOB                 7
    BILL                5
    BILL                8
    BILL
    SQL> SELECT name, total, scored
      2  FROM (SELECT name, count(*) total, count(score) scored
      3        FROM skill
      4        GROUP BY name)
      5  WHERE total <> scored;
    NAME            TOTAL     SCORED
    BILL                3          2

  • Using Disc Utility to copy my hard drive to a brand new external drive and am having the error "Unable to create...(Cannot allocate memory)".

    I'm not very tech savvy but am trying my best to use Disc Utility to copy my hard drive to a brand new external drive and am having the error "Unable to create...(Cannot allocate memory)".
    Last night no problems, woke this morning and it was freezing so I forced a restart and got the grey screen with the folder and question mark. Ran off to best buy to get an external drive... Please help! Thank you!

    I have done both. When I hold down the "C" key it pauses for a few seconds while the cd spins and then the flashing folder icon appears.
    Could be you have the wrong cd/dvd.  The mac will only boot a supported cd/dvd for your machine. The flashing question mark indicdates your machine could not find a valid os.
    When I hold down the "option" key for the startup manager the cursor comes up and moves but the actually manager doesn't come up no matter how long I leave the laptop on.
    Not sure.  Could be your machine does not support the startup manager. You would think the machine would ignore the key.
    Where did you get the dvd?  What is the number on the DVD?
    What machine do you have anyway?
    This site provides more information, but lacks security.
    "A serial number is a unique, identifying number or group of numbers and letters assigned to an individual piece of hardware or software. It's used for various things depending on the product / brand but what is your Mac's serial number for and more importantly... what is it hiding and what can it do for you ?"
    http://www.appleserialnumberinfo.com/Desktop/index.php
    or
    This site provides more information, but lacks security too.
    "A serial number is a unique, identifying number or group of numbers and letters assigned to an individual piece of hardware or software. It's used for various things depending on the product / brand but what is your Mac's serial number for and more importantly... what is it hiding and what can it do for you ?"
    http://www.appleserialnumberinfo.com/Desktop/index.php
    http://www.chipmunk.nl/klantenservice/applemodel.html
        ( hint by K Shaffer  )

  • Is anyone else having Config error 16 issue when trying to start PSE 12 or Premier Elements after Mac upgrade to Yosemite 10.10 on iMac

    Is anyone else having Config error 16 issue when trying to start PSE 12 or Premier Elements 12 after the Mac upgrade to OS X Yosemite 10.10 on iMac. I have had a number of issues with software and things after upgrading to OS X Yosemite 10.10 and even 10.10.1.  I have uninstalled and reinstalled both PSE 12 and Premier Elements 12 a number of times and everything goes fine until its ready to launch and then you get an error message. Numerous uninstalled and reinstalls don't removing the problem.  Strangely enough  PSE 11 still appears to boot up and I never owned Premier Elements 11 so I don't know if it will start. I thought with Apple dropping its Apeture software and greater integration of iPhoto and Apeture files into Lightroom 5.7 all would be harmonious between these two players. Im not sure where Adobe wants us to go it recently removed the plugin to allow you to update files from LR to Adobe Revel, whats up with that. I now own two version of Adobe software that no longer work with my Mac and now way of uploading pictures from Lightroom to Revel. Needless to say I am pretty reluctant to sign on to a subscription of Creative Cloud with long term financial obligations when I can't even get my current Adobe software to work independently much less integrate with Lightroom. Frustrated with it all!

    Get rid of 'put disks to sleep when possible' and you may see a dramatic improvement (not necessarily a cure).
    That specific problem is a multiple-Processor (including graphics processor) problem, where one of the processors lost track of whether it should be responding to interrupts. You may have a Hardware problem.

  • HT1848 I cannot authorize my computer, I'm having this error message The required file was not found or has a permissions error. Correct this permissions problem and try again, or deauthorize this computer if the permissions cannot be changed." please hel

    cannot authorize my computer, I'm having this error message The required file was not found or has a permissions error. Correct this permissions problem and try again, or deauthorize this computer if the permissions cannot be changed." please help me

    Doublechecking. In the course of your troubleshooting to date, have you worked through the instructions from the following document?
    iTunes: Missing folder or incorrect permissions may prevent authorization

Maybe you are looking for