1

I am not able to execute this query getting

ORA-00933: SQL command not properly ended
00933. 00000 - "SQL command not properly ended"

select count(user_id) 
from t_user 
where user_id = 2699478, object_id = 1329 
  and user_id not in
      (SELECT owner_user_id FROM t_obj where actual_id = 17447);  
1
  • 1
    Can only only guess what you intended the query to do but the comma after user_id=2699478 is the problem, could be an AND or OR?? Commented Jun 20, 2012 at 15:54

4 Answers 4

5

You have to replace the comma , between the two conditions user_id=2699478 ,object_id=1329 with a proper conditional operators, and use parentheses to express them the way you want, like this:

SELECT COUNT(user_id) 
FROM t_user 
WHERE user_id = 2699478 
  AND object_id = 1329 
  AND user_id NOT IN
    (
        SELECT owner_user_id 
        FROM t_obj 
        WHERE actual_id = 17447
    ) 
Sign up to request clarification or add additional context in comments.

Comments

4

Try replacing your comma with AND:

select count(user_id) from t_user where user_id=2699478 AND object_id=1329 and user_id not in
  (SELECT owner_user_id FROM t_obj where actual_id = 17447);

Comments

3

Replace a comma by and:

select count(user_id)
from t_user
where user_id=2699478
  and object_id=1329
  and user_id not in (SELECT owner_user_id FROM t_obj where actual_id = 17447);

Comments

1

You need to replace the comma with an "AND":

SELECT count(user_id) FROM t_user WHERE user_id=2699478 AND object_id=1329 AND user_id NOT IN
      (SELECT owner_user_id FROM t_obj WHERE actual_id = 17447);  

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.