2

Please explain why the following query:

select      in.status                    as "no_installments"
,           count(in.id)             as "installment"
FROM        instalsched.instalment in
GROUP       BY in.status;

returns

ORA-00936: missing expression 00936. 00000 - "missing expression" *Cause:
*Action: Error at Line: 1 Column: 12

3 Answers 3

2

in is a key word in SQL. It is used as part of a where clause, such as where person_id in (1,2,3,4). To remedy, simply change the alias.

select
   in1.status as "no_installments",           
   count(in1.id)             as "installment"
FROM instalsched.instalment in1
GROUP BY in1.status;
Sign up to request clarification or add additional context in comments.

Comments

0

in is a keyword. Use a different alias or wrap it in double quotes.

Comments

0

"in" is a reserved word in SQL syntax. You should try to use other non-reserved word like "inst" or something similar.

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.