Home » Developer & Programmer » Application Express, ORDS & MOD_PLSQL » ORA-00920: invalid relational operator  () 1 Vote
icon7.gif  ORA-00920: invalid relational operator [message #239633] Tue, 22 May 2007 19:04 Go to next message
HIMULE
Messages: 8
Registered: May 2007
Location: Pleasanton, CA
Junior Member
Please find the SQL query I am trying to execute;

SELECT *
FROM CNT913_TATV020_CRIS_SALES A
,CNT911_TATV010_CRIS_SONBR B
WHERE
B.SERVICE_ORDER_NBR = A.SERVICE_ORDER_NBR
AND B.REGION_CD = A.REGION_CD
AND B.DIVISION_CD = A.DIVISION_CD
AND
(SUBSTR(A.SUB_CLASS_OF_SERVICE_CD,1,3)
OR SUBTR(B.CLASS_OF_SERVICE_CD,1,3)) NOT IN
(SELECT COS_PREFIX
FROM TEMP_CNT115_CLASS_OF_SERVICE
WHERE SUBSTR(SUBSID_CD,1,2) = 'MW')

When I run the query, I go tthe following error;

Code = 920.
920: ORA-00920: invalid relational operator
Output directed to Answer set window

Please advise. My code seem to be ok but the message is saying that i am using an invalid relational operator.
Re: ORA-00920: invalid relational operator [message #239650 is a reply to message #239633] Tue, 22 May 2007 23:34 Go to previous messageGo to next message
janu
Messages: 4
Registered: January 2007
Junior Member
Hi Himule,

I think the 'OR' condition is placed in the wrong area.
Try the following code.
SELECT *
  FROM cnt913_tatv020_cris_sales a, cnt911_tatv010_cris_sonbr b
 WHERE b.service_order_nbr = a.service_order_nbr
   AND b.region_cd = a.region_cd
   AND b.division_cd = a.division_cd
   AND (   SUBSTR (a.sub_class_of_service_cd, 1, 3) NOT IN (
                                          SELECT cos_prefix
                                            FROM temp_cnt115_class_of_service
                                           WHERE SUBSTR (subsid_cd, 1, 2) =
                                                                          'MW')
        OR (subtr (b.class_of_service_cd, 1, 3) NOT IN (
                                          SELECT cos_prefix
                                            FROM temp_cnt115_class_of_service
                                           WHERE SUBSTR (subsid_cd, 1, 2) =
                                                                          'MW')
           )
       )
icon14.gif  Re: ORA-00920: invalid relational operator [message #239933 is a reply to message #239650] Wed, 23 May 2007 12:34 Go to previous message
HIMULE
Messages: 8
Registered: May 2007
Location: Pleasanton, CA
Junior Member
Hi Janu!

I actually tried that solution earlier. At first, I was hesitant because it might slow down the process a bit. But as long as the execution is linear, time complexity is out of the question. I don't know why it didn't work the first time. But, when I recoded it today, it worked.

Thanks for you suggestion.

Hazel
Previous Topic: dynamci drop down menu
Next Topic: closing parent window from child window thru PL/SQL
Goto Forum:
  


Current Time: Thu Apr 18 19:04:13 CDT 2024