untrue error message in Oracle SQL

By john.a.wills ·
Tags: Software
I have in a query the following column, to yield a list of telephone numbers with some data for each. The summation is to deal with duplicate telephone numbers having different characteristics, e.g. a CE phone which is also the person's TX phone, and to yield the telephone number once only with an appropriate code for the multiplicity of characteristics. I think the structure is pretty clear. The rest of the query works correctly, and this column runs correctly in an earlier version, which does not unite the information for duplicate numbers.
|| case sum (case high.SPRTELE_TELE_CODE
when 'HM' then 2
when 'CE' then 2
when 'TX' then 1
else 0
end) over (order by nvl (sprtele_ctry_code_phone, '1'), sprtele_phone_area, sprtele_phone_number)
when 0 then 'high mistake'
when 1 then '1'
when 2 then '2'
when 3 then '3'
when 4 then '2'
when 5 then '3'
else 'deep mistake'
|| '|' || nvl (high.SPRTELE_CTRY_CODE_PHONE, '1')
|| '|' || STVTELE.STVTELE_DESC, ';')
within group (order by nvl (sprtele_ctry_code_phone, '1'), sprtele_phone_area, sprtele_phone_number) as "Telephone"

When I submit the query in Argos, SQL Developer or SQLPlus, I get the error message that I have a missing right parenthesis. But that is not true. What does Oracle really mean to say? In SQLPlus, a start appears under the "s" of "sum". How can I get this structure working? Is there something wrong with the "over" clause?

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Related Discussions

Related Forums