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...

J

Read below for informative post from Frank Kulash on ABC in the group by clause
{message: id = 9969583}

Tags: Database

Similar Questions

  • 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

  • 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
     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;
    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".

    Can someone suggest a way for a new concert the query so that I can add po_number to my education by clause.

    Kris

    You 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;

  • 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,
    CKLP

    Published by: CKLP April 14, 2011 22:10

  • 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:

    Ask Tom & quot; Group By clause & quot;

  • Not a group by Expression

    I have the following table AR_Complex

    Country_codeCountryComplex_AmtChild_Amt
    CC_1CC50001000
    CC_1CC1000
    CC_1CC2000
    CC_1CC1000
    US_2WE30001000
    US_2WE500
    US_2WE200
    US_2WE100

    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

  • 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_code

    Quite a few differences...

  • 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;
    
  • in Outlook Express, how can I send the same message to a group important (in the address book already), but have to each recipient can only see his name (not the Group)

    In Outlook Express, how can I send the same message to the large group (already in the address book), but have to each recipient can only see his name (not the Group)?

    To use the functionality of the BCC (Blind Carbon Copy), in a new message window, click View | All headers and type the addresses separated by a; Or: Click the button to. You will see your list of contacts and the choice to put them in the To, CC, or BCC field. Click on an address, and then click BCC to add it. Repeat for all of the contacts you want. (Note: most of the providers have limits as to how many messages you can send both a. 25 is common, but it varies).

    Put your own address in the box to. That's the only name/address that any recipient will see. If you leave the field empty, some people may not receive e-mail because of message rules they put in place, or restrictions imposed by their ISP.

    You can also make an entry in the address book using your e-mail address, but put something like the mailing list in the area of the display.

    *********************

    You can also create groups if you send e-mail to the same people often.

    To create a group of contacts:

    You can create a single group name (or alias) to use when sending a message to several contacts at the same time. Just create a group name and add individual contacts to the group. Then just type the name of the group in the box for when you send mail.

    1. in the address book, select the folder in which you want to create a group. Click New in the toolbar, and then click New Group.
    2. the Properties dialog box opens. In the group name box, type the name of the group.
    3. There are several ways to add people to the Group:
    a. to add a person from your address book list, click Select members, and then click a name in the address book list.
    (b) to add a person directly to the group without adding the name to your address book, type the person's name and e-mail address at the bottom of the Properties dialog box and then click Add.
    to add a person to both the Group and your address book, click New Contact and enter the appropriate information.
    (d) to use a directory service, click Select members, and then click search. Select a directory service in the drop-down list at the end of the text box. After finding and selecting an address, it is automatically added to your address book.
    4. Repeat for each addition until your group is defined.

    Note

    a. to view a list of your groups separately from the list of address book in the address book on the view menu, make sure that folders and groups is selected.
     
    b. you can create multiple groups, and contacts can belong to several groups.

    If you want to send to a group without addresses are displayed for each recipient, open the address book and make a new entry. Enter the name of the group in the area of the display, but use your address. (Some Internet service providers require a legitimate address in the line to and recipients will know it's from the Group).

    Click on the button to. Enter the name of the group using your address. Enter the group in the BCC field.

  • Not a GROUP BY clause error

    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

  • ERROR: ORACLE prepare error: ORA-00936: lack of expression

    Hello

    I am required to run the 'pass-through' Oracle SQL, to extract data from tables in the SAS for processing and handling. My code (attached) reads and writes (runs) but with zero records to test first. I can't get beyond the error to prepare.

    The request is just like other queries that seem to work, but I can't get past this prepare error. I have no other access to individauls with an adequate knowledge of the PL SQL and as a last stop hoped others in the forum could quickly identify the source of the error.

    Thank you very much in advance for any help.

    Jeff
    _______________________________________

    1; *'; * « ; * / ; Quit; execution risk;
    2 OPTIONS NUMPAGE = MIN;
    3% LET _CLIENTTASKLABEL = % NRBQUOTE (rx_biplr_v3_2);
    4% LET _EGTASKLABEL = % NRBQUOTE (rx_biplr_v3_2);
    5% LET _CLIENTPROJECTNAME = %NRBQUOTE();
    6% LET _SASPROGRAMFILE =;
    7
    8 ODS CLOSE SUBJECT;
    NOTE: Some of your options or statements will not be managed with the Activex or Java Series devices. Chart by default for these
    drivers may be different from other SAS/GRAPH device drivers. For more information, please contact Technical Support.
    9 OPTIONS DEV = ACTIVEX;
    10 EGHTML TEMP FILE NAME;
    NOTE: Writing, body HTML (EGHTML) file: EGHTML
    11 ODS HTML(ID=EGHTML) FILE = EGHTML ENCODING = 'utf - 8' STYLE = EGDefault.
    11. STYLESHEET=(URL="file:///C:/program%20Files/SAS/shared%20Files/BIClientStyles/EGDefault.CSS")
    11. ATTRIBUTES = ("http://www2.sas.com/codebase/graph/v91/sasgraph.exe"="CODE") NOGTITLE NOGFOOTNOTE GPATH = & sasworklocation
    11.
    12
    gaccessible 13%;
    14 /********************************************************/
    15 * RX_BIPLR_V3. SAS;
    16 /********************************************************/
    17
    18 dm 'journal clearly out; delete ";
    19 linesize options = 120;
    20 option obs = 0 NoReplace;
    21
    22 ****************************************************************************************;
    23 * date reviewed programmer in WHICH WAS MADE;
    24 *----- -------------- ------------ -----------------------------------------;
    25 * 2005 creation of David Boyd program to the test population;
    26 *;
    27 * 06/02/2006 Ivon Jones changed to include the whole of the population;
    28 *;
    29 * 20/07/2006 Ivon Jones identified the holdout data elements;
    30 * or inclusion in the consolidation with;
    31 * Robin report;
    32 *;
    33 * 18/08/2006 Ivon Jones updated specific therapeutic Classes.
    34 * 10 - 2009 J Shaf - changed to extract actual or potential of UBH bipolar Dx and medical claims.
    35 ****************************************************************************************;
    36
    37
    38
    39 * % let allclmorgn = (', 'A'); / * claims origin code * /.
    40% would let begdate ='01 SEP 2009;
    41% let enddate = 30 SEP 2009 would be;
    42% let q = %str(%');
    43
    44
    45 data _null_;
    46. call symput ("fdos", put (intnx ('month' ' and begdate "d,-27," starts"), date9.));
    47 call symput ('ldos', put (intnx ('months', ' and enddate "d-0, 'end'" "), date9.));
    48, run;

    NOTE: DATA statement used (total duration of processes):
    time real 0.01 seconds
    2 the system SAS 11:44 Friday, October 30, 2009

    time CPU 0.01 seconds


    49
    50
    51
    52 **************************************************************;
    53 *? Data _null_ stage allows to create a macro variable to;
    54 * year and month, based on the macro ldos variable in the data;
    55 * step up? ;
    56 **************************************************************;
    57
    58
    59 data _null_;
    If 60 months ("& ldos" d) < 10
    61, then call symput ("yr_mo", compress (year ("& ldos" d) |)) '0' || months ("& ldos" d)));
    62 other call symput ("yr_mo", compress (year ("& ldos" d) | months ("& ldos" d)));
    63 to run;

    NOTE: The numeric values were converted to character values in the locations given by: (Line): (Column).
    61:39 61:64 62:39 62:57
    NOTE: DATA statement used (total duration of processes):
    time real 0.01 seconds
    time processor 0.01 seconds


    64
    65 * make % & biplr_dx;
    position 66% & begdate;
    ' 01 SEP 2009 would be
    67% put & enddate;
    30 SEP 2009 would be
    68% put & fdos;
    JUNE 1, 2007
    69% put & ldos;
    SEPTEMBER 30, 2009
    70% put & q;
    '
    71
    72
    73 libname biplr ' / home/jshafi01/projects/adhoc/biplr_dprsn/data ';
    NOTE: Libref BIPLR has been awarded with success as follows:
    Engine: V9
    Physical name: / home/jshafi01/projects/adhoc/biplr_dprsn/data
    74 rosdwp libname = oracle user "& oracle_user." pass = "& oracle_pass." ' buffsize = 32767 path = "rosdwp"; "
    NOTE: Libref ROSDWP has been awarded with success as follows:
    Engine: ORACLE
    Physical name: rosdwp
    75
    work.biplr_up_v1 76 data;
    mbr_id length 77 attrib = $ 26;
    78 the value biplr.biplr_ubh_med_v1;
    79 to be performed;

    NOTE: There were 0 read comments from the BIPLR data set. BIPLR_UBH_MED_V1.
    NOTE: All data WORK. BIPLR_UP_V1 has 0 comments and variables 1.
    NOTE: DATA statement used (total duration of processes):
    time real 0.01 seconds
    3 the system SAS 11:44 Friday, October 30, 2009

    time processor 0.01 seconds


    80
    81 proc content;
    82 to be performed;

    NOTE: PROCEDURE used CONTENT (total duration of processes):
    time real 0.03 seconds
    time CPU 0.03 seconds


    83
    84 proc datasets
    85 = rosdwp nolist library.
    86. delete biplr_up_v1;
    87 of quitting;

    NOTE: The removal of ROSDWP. BIPLR_UP_V1 (memtype = DATA).
    NOTE: PROCEDURE used DATASETS (time Total of processes):
    time real 3.74 seconds
    time CPU 0.03 seconds


    88
    89 proc datasets
    90 = work nolist library.
    copy 91 = rosdwp move;
    92 select biplr_up_v1;
    93 of quitting;

    NOTE: Move WORK. BIPLR_UP_V1 to ROSDWP. BIPLR_UP_V1 (memtype = DATA).
    NOTE: Variable labels SAS, formats and lengths are not written to the DBMS tables.
    NOTE: There were 0 read comments from the WORKING data set. BIPLR_UP_V1.
    NOTE: All the data ROSDWP. BIPLR_UP_V1 has 0 comments and variables 1.
    NOTE: PROCEDURE used DATASETS (time Total of processes):
    real 0.32 seconds
    time CPU 0.04 seconds


    94
    95
    96
    97 *****************************************************************************;
    98
    99 * execute (commit) by rosdwp
    100 ******************************************************************************;
    101
    102
    103 proc SQL noprint.
    104, connect to oracle as rosdwp (user = "" & oracle_user. "password =" "& oracle_pass ' buffsize = 32767 path ="rosdwp")
    104. preserve_comments);
    run 105 (alter session set nls_date_format = 'ddmonyyyy') by rosdwp;
    CREATE table biplr_rx like 106
    107 SELECT
    mrb_id 108,
    pcp_spc 109,
    rx_date 110,
    4 the system SAS 11:44 Friday, October 30, 2009

    Mark 111,
    generic, 112
    113 ahfs_cd
    ahfs_dsc 114,
    lbl 115,
    strngth 116,
    UNT 117,
    spc_tx_cls_cd 118,
    119 spc_tx_cls_dsc,
    GCN 120,
    rx_num 121,
    rx_ingrd 122,
    rx_paid 123,
    rx_cnt 124,
    rx_qty 125,
    rx_day 126
    127 rosdwp CONNECTION
    128 (SELECT
    129, middle of the year. UNIQ_MBR_ID as mrb_id,
    130 DB. PRVDR_SPCLTY_DESC as pcp_spc,
    FCP 131. LAST_SRVC_DT as rx_date,
    132 JJ. BRAND_NAME as mark,
    133 JJ. GNRC_NAME as generic,
    134 JJ. AHFS_THRPTC_CLS_CD as ahfs_cd,
    DD 135. AHFS_THRPTC_CLS_DESC as ahfs_dsc,
    136 JJ. LABEL_NAME as lbl,
    137 JJ. STRNGTH_NUM as strngth
    138 JJ. STRNGTH_UNIT_DESC as unt,
    139 JJ. SPECF_THRPTC_CLS_CD as spc_tx_cls_cd,
    140 DD. SPECF_THRPTC_CLS_DESC as spc_tx_cls_dsc,
    141 JJ. GCN_NUM as gcn,
    FCP 142. PRSCRPTN_NUM as rx_num,
    SUM of 143 (FCP. INGRDNT_AMT) as rx_ingrd,
    SUM of 144 (FCP. PD_AMT) as rx_paid,
    $ 145 (FCP. UNIT_SRVC_CNT) as rx_cnt,
    SUM of 146 (FCP. DSPNSD_QTY) as rx_qty,
    SUM of 147 (FCP. DAY_SUPLY_CNT) as rx_day
    148
    149 PHRMCY_CLM_FACT pcf,
    150 MBR_ID_DMNSN environment,
    151 DRUG_DMNSN dd,
    152 PRVDR_DMNSN pd,
    153 biplr_up_v1
    154. WHERE THE
    (155)
    156 (biplr_up_v1.mbr_id = MBR_ID_DMNSN. UNIQ_MBR_ID) and
    157 (PHRMCY_CLM_FACT. FINL_CLM_KEY = PHRMCY_FINL_CLM_DMNSN. FINL_CLM_KEY) AND
    158 (PHRMCY_CLM_FACT. MBR_KEY = MBR_ID_DMNSN. MBR_KEY) and
    159 (PHRMCY_CLM_FACT. BNFT_KEY = MBR_BNFT_DMNSN. BNFT_KEY) and
    160 (PHRMCY_CLM_FACT. DRUG_KEY = DRUG_DMNSN. DRUG_KEY) and
    161 (PHRMCY_FINL_CLM_DMNSN. CLM_ORGN_CD IN (', 'A')) AND
    162 (PHRMCY_CLM_FACT. LAST_SRVC_DT BETWEEN q. & fdos. & q and & q. & ldos. & q)
    163)
    164 Group By
    165 mi. UNIQ_MBR_ID,
    166 pd. PRVDR_SPCLTY_DESC,
    FCP 167. LAST_SRVC_DT,
    168 JJ. BRAND_NAME,
    5 the system SAS 11:44 Friday, October 30, 2009

    169 JJ. GNRC_NAME,
    170 JJ. AHFS_THRPTC_CLS_CD,
    171 JJ. AHFS_THRPTC_CLS_DESC,
    172 JJ. LABEL_NAME,
    173 JJ. STRNGTH_NUM,
    174 JJ. STRNGTH_UNIT_DESC,
    175 JJ. SPECF_THRPTC_CLS_CD,
    176 JJ. SPECF_THRPTC_CLS_DESC,
    177 JJ. GCN_NUM,
    FCP 178. PRSCRPTN_NUM
    179);
    ERROR: ORACLE prepare error: ORA-00936: lack of expression. SQL statement: SELECT middle. UNIQ_MBR_ID as mrb_id,
    RDL PRVDR_SPCLTY_DESC like pcp_spc, FCP. LAST_SRVC_DT as rx_date, JJ. BRAND_NAME as brand, JJ. GNRC_NAME as generic,
    DD. AHFS_THRPTC_CLS_CD like ahfs_cd, JJ. AHFS_THRPTC_CLS_DESC as ahfs_dsc, JJ. LABEL_NAME as lbl, JJ. STRNGTH_NUM as
    strngth, JJ. STRNGTH_UNIT_DESC as unt, JJ. SPECF_THRPTC_CLS_CD as spc_tx_cls_cd, JJ. SPECF_THRPTC_CLS_DESC as
    spc_tx_cls_dsc, JJ. GCN_NUM as gcn, FCP. PRSCRPTN_NUM as rx_num, SUM (FCP. INGRDNT_AMT) as rx_ingrd, SUM (FCP. PD_AMT)
    as rx_paid, SUM (FCP. UNIT_SRVC_CNT) as rx_cnt, SUM (FCP. DSPNSD_QTY) as rx_qty, SUM (FCP. DAY_SUPLY_CNT) as rx_day
    OF PHRMCY_CLM_FACT pcf, MBR_ID_DMNSN mi, DRUG_DMNSN JJ, pd of the PRVDR_DMNSN, biplr_up_v1 () WHERE the
    (biplr_up_v1.mbr_id = MBR_ID_DMNSN. UNIQ_MBR_ID) and (PHRMCY_CLM_FACT. FINL_CLM_KEY =
    PHRMCY_FINL_CLM_DMNSN. FINL_CLM_KEY) AND (PHRMCY_CLM_FACT. MBR_KEY = MBR_ID_DMNSN. MBR_KEY) and
    (PHRMCY_CLM_FACT. BNFT_KEY = MBR_BNFT_DMNSN. BNFT_KEY) and (PHRMCY_CLM_FACT. DRUG_KEY = DRUG_DMNSN. DRUG_KEY) and
    (PHRMCY_FINL_CLM_DMNSN. CLM_ORGN_CD IN (', 'A')) AND (PHRMCY_CLM_FACT. LAST_SRVC_DT BETWEEN ' 01 JUN 2007"
    and 30 SEP 2009') Group By mi. UNIQ_MBR_ID, pd. PRVDR_SPCLTY_DESC, FCP. LAST_SRVC_DT, JJ. BRAND_NAME,
    DD GNRC_NAME, JJ. AHFS_THRPTC_CLS_CD, JJ. AHFS_THRPTC_CLS_DESC, JJ. LABEL_NAME, JJ. STRNGTH_NUM,
    DD STRNGTH_UNIT_DESC, JJ. SPECF_THRPTC_CLS_CD, JJ. SPECF_THRPTC_CLS_DESC, JJ. GCN_NUM, FCP. PRSCRPTN_NUM.
    NOTE: PROC SQL set NOEXEC option and will continue to check the syntax of the instructions.
    180 run (drop table biplr_up_v1) in rosdwp;
    NOTE: Statement is not executed because the NOEXEC option.
    181 disconnect of rosdwp;
    NOTE: Statement is not executed because the NOEXEC option.
    182 of quitting;
    NOTE: The SAS system is stopped at this stage of processing errors.
    NOTE: PROCEDURE used SQL (total duration of processes):
    time real 0.14 seconds
    time CPU 0.03 seconds

    183
    184

    (1) assuming that LAST_SRVC_DT is a column of PHRMCY_CLM_FACT, to precede the table alias "FCP" rather than the full table name. If a table alias is specified in the FROM clause, it should be used rather than the full table name when you reference the columns.
    2) there are two tables in the WHERE clause that do not appear in the FROM clause:

    PHRMCY_FINL_CLM_DMNSN
    MBR_BNFT_DMNSN

    user12142482 wrote:
    Hello again,

    Wish Oracle was a bit more informative. Uses an Institute of SAS product called Enterprise Guide. A "hot fix" has been installed to solve a problem that the product appears unable to save the latest version of the revised code changes (hence "BETWEEN between" remaining even after an earlier edition). In any case, with the change, now get this error:

    «ERROR: ORACLE prepare error: ORA-00904: "PHRMCY_CLM_FACT".» ' LAST_SRVC_DT': invalid identifier. (The log file is displayed below)

    -The-Les restes remains of the error, no matter if code "pass" is used to move the date range to Oracle (which seems correct to the log output below that I believe), or if I hard code the date range in the query SQL PL itself.

    -L' preparation error always appears at the end of the internal SELECTION.
    -L' error of preparation remain, with or without the GROUP BY clause.

    Is there something else I'm missing? Someone suggested a reserve word - but other versions of the ANSI SQL standard, I don't see that is the case. I went to Support SAS and SAS list serve to the University of Georgia, but nothing definite from these sources. Have requested either able to run Oracle directly, outside this SAS Institute product - process.

    Any suggestions are greatly appreciated. Thank you to all the world very much.

    Jeff
    150 OF
    151 PHRMCY_CLM_FACT pcf,


    152 MBR_ID_DMNSN environment,
    153 DRUG_DMNSN dd,
    154 PRVDR_DMNSN pd,
    155 BIPLR_UP_V1 BLPR2
    156. WHERE THE
    157 (BIPLR_UP_V1.mbr_id = MBR_ID_DMNSN. UNIQ_MBR_ID) and
    158 (PHRMCY_CLM_FACT. FINL_CLM_KEY = PHRMCY_FINL_CLM_DMNSN. FINL_CLM_KEY) AND
    159 (PHRMCY_CLM_FACT. MBR_KEY = MBR_ID_DMNSN. MBR_KEY) and
    160 (PHRMCY_CLM_FACT. BNFT_KEY = MBR_BNFT_DMNSN. BNFT_KEY) and
    161 (PHRMCY_CLM_FACT. DRUG_KEY = DRUG_DMNSN. DRUG_KEY) and
    162 (PHRMCY_FINL_CLM_DMNSN. CLM_ORGN_CD IN (', 'A')) AND
    163 (PHRMCY_CLM_FACT. BETWEEN LAST_SRVC_DT & q. & fdos. & q and q & ldos. & q)
    (164);
    ERROR: ORACLE prepare error: ORA-00904: "PHRMCY_CLM_FACT." "' LAST_SRVC_DT ': invalid identifier. SQL statement:

  • RES://C:\Windows\system32\mmcndmgr.dll/views.htm (error not found)

    HI, I am unable to solve this help please me...

    RES://C:\Windows\system32\mmcndmgr.dll/views.htm (error not found)
    By these Services on the server are not begin in 2008r2


    (1) group policy

    (2) Service Control Manager

    (3) the Client DNS events

    (4) browser

    (5) Kerberos security

    All the above services do not solve & due to this FSMO roles are
    not work & unable repeated files.

    Please help me on this point, it's to create a big problem for me here.

    Hi Varun,

    I suggest that you post this question in the Windows Server 2008 support TechNet forums: http://technet.microsoft.com/en-us/windowsserver/bb512923

    Thank you.

  • Error - exception error not supported for user - Help!

    Hi all

    I get an exception error unsupported to the user in a part of my page is refreshed after encountering a validation error.  Validation is managed properly, but when the page is refreshed to display I get an exception error not support for the user for the following code (generates the value of the element on the page):

    < code >

    Select nvl (sum (po_details.po_det_amt), 0)

    of po_details

    where po_details.po_id =: P230_PO_ID

    and po_details.wbs in (select distinct wbs_number_id of wbs, project

    where wbs.vendor_id =: P230_VENDOR

    and substr (wbs.wbs_number_id, 1, 6) = project.wbs_sequence

    and project.project_number = nvl (:F101_FPC_NUMBER,project.project_number));

    < code >

    When the code retrieves a single value, the following post calculation calculation of:

    < code >

    to_char(:P230_PO_AMT_FPC,'FML999G999G999G999G990D00');

    < code >

    Generally, the process works.  It is only when a validation run which prevents the removal of a purchase order that I encounter an error during a refresh of the page.  I get an exception error unsupported to the user for this calculation.  I'm puzzled.

    Any ideas?

    to_char(:P230_PO_AMT_FPC,'FML999G999G999G999G990D00');

    AFAIK - all within the APEX bind variables are of type VARCHAR2

    That means - you are implicitly expressing a string to a different data type just to cast to a string.

    So: this code is completely useless and adds more complication to the mix only what you need.

    It is very possible that Oracle is trying to convert a DATE... (which will fail)

    I put either the FORMAT for the type of element to match what you need or make the conversion from the string in your SELECT statement.

    for example

    Select to_char (nvl (sum (...), 0), "FML999G999G999G999G990D00")

    If you still get a 'user defined error', it is likely to be lifted since within the procedure used to remove the PO.

    See the DEBUGGING within the APEX pages to check exactly where the error is thrown.

    (it sounded like you already did and have reduced in to_char() section)

    MK

  • Apple Watch: can I receive all messages from whatsapp on my Apple Watch, but not the Group whatsapp messages, don't know why... Help, please. Besides, my watch is custom in Spanish, but only answer messages Whatsapp understands English... someone kn

    I can receive all messages from whatsapp on my Apple Watch, but not the Group whatsapp messages, don't know why... Help, please.

    Besides, my watch is custom in Spanish, but only answer messages Whatsapp understands English... anyone know why? Thanks to you all!

    Hello

    To change the language for a response on your watch: Press answer > firmly press the screen > press on choose language > select Spanish.

Maybe you are looking for