-
CO is not a column?
I have an assignment where I have to list out all the employees in europe. Now, I know how to do this but I've hit a roadblock. I need to figure out which country a location is in, which would be easy except I keep getting the same error.
Here's a nice example:
Code:
SQL> select * from hr.countries;
CO COUNTRY_NAME REGION_ID
-- ---------------------------------------- ----------
AR Argentina 2
AU Australia 3
BE Belgium 1
BR Brazil 2
CA Canada 2
CH Switzerland 1
CN China 3
DE Germany 1
DK Denmark 1
EG Egypt 4
FR France 1
... *snip*
25 rows selected.
SQL> select CO from hr.countries;
select CO from hr.countries
*
ERROR at line 1:
ORA-00904: invalid column name
CO is clearly a column, yet it refuses to be used in a statement?? How can I select this column?
-
Re: CO is not a column?
CO might be a reserved word...
Try:
select [CO] from hr.countries
instead
BTW - what database are you using?
-
Re: CO is not a column?
I think it's an oracle database (the error code is ORA).
The square brackes give me a different error:
Code:
SQL> select [co] from hr.countries;
select [co] from hr.countries
*
ERROR at line 1:
ORA-00936: missing expression
-
Re: CO is not a column?
Try double quotes.
Code:
select "co" from hr.countries;