Results 1 to 2 of 2

Thread: SQL QUERY New

  1. #1
    Join Date
    Nov 2012
    Posts
    1

    SQL QUERY New

    I have tryed to get this working for last 4 hours. Please help. The View works and when i run the query i get the count but no column name, so i use an inner query but get this error

    ORA-00934: group function is not allowed here
    00934. 00000 - "group function is not allowed here"
    *Cause:
    *Action:
    Error at Line: 1,817 Column: 62

    PLEASE help me.

    create view Details as (select insured_item.C_model, count(policy.policy_ID) as Counter
    from insured_Item, policy, insured_by, client, person
    where
    Insured_Item.item_ID = policy.Item_ID
    and policy.policy_ID = insured_by.policy_ID
    and insured_by.client_ID = client.client_ID
    and client.personal_ID = person.personal_ID
    and person.suburb ='Randwick'
    group by C_model)

    select MAX(Counter) as MaxC
    from Details
    where C_model = (select C_model from Details where C_model = Max(Counter) )

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    Did you try it on Oracle forum?

Posting Permissions

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