2
votes

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

3 Answers

2
votes

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;
0
votes

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

0
votes

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