Results 1 to 4 of 4

Thread: Error In Group

  1. #1
    Join Date
    Apr 2004
    Posts
    38

    Unanswered: Error In Group

    SQL> SELECT FRANCHISE.B_ID,FRANCHISE.FR_ID,FRANCHISE.FR_NAME,S ALE.P_ID,PRODUCT.P_NAME,SUM(SALE.QUANTITY)AS TOTAL,SALE.SA_DATE
    2 FROM SALE,PRODUCT,FRANCHISE

    *
    ERROR at line 1:
    ORA-00979: not a GROUP BY expression
    Last edited by fj8283888; 05-18-04 at 07:57.

  2. #2
    Join Date
    May 2004
    Posts
    17
    try this

    SELECT FRANCHISE.B_ID,FRANCHISE.FR_ID,FRANCHISE.FR_NAME,S ALE.P_ID,PRODUCT.P_NAME,SUM(SALE.QUANTITY)AS TOTAL
    FROM SALE,PRODUCT,FRANCHISE
    WHERE SALE.FR_ID=FRANCHISE.FR_ID AND PRODUCT.P_ID=SALE.P_ID
    GROUP BY FRANCHISE.B_ID,FRANCHISE.FR_ID,FRANCHISE.FR_NAME,S ALE.P_ID,PRODUCT.P_NAME;

    and let me know the results

  3. #3
    Join Date
    Apr 2004
    Posts
    38

    Transaction

    It's Not Working In Some How

  4. #4
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    All columns that are NOT part of an aggregate function (SUM in your query) MUST be included into the GROUP BY clause.

    PHP Code:
    SELECT 
    franchise
    .b_id
    franchise.fr_id
    franchise.fr_name
    sale.p_id,
    product.p_name
    SUM (sale.quantity) AS total
    sale.sa_date
    FROM sale
    productfranchise
    GROUP BY 
    franchise
    .b_id,
    franchise.fr_id,
    franchise.fr_name,
    sale.p_id,
    product.p_name,
    sale.sa_date
    Last edited by Littlefoot; 05-18-04 at 08:16.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •