K
K
kodwi2015-03-19 15:29:38
Oracle
kodwi, 2015-03-19 15:29:38

How to set aliases in SQL for Oracle database?

There is a request, in MS Access it plows, in Oracle it swears.
Request piece:

SELECT 

SUM(test_table.count_of_items) AS count_for_december,
...

Swears at invalid identifier count_for_december

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Markus Kelvin, 2015-03-19
@mmxdesign

The syntax is correct, try other options like:
1. without AS, since your name is merged
2. without symbols _ and instead the name in "count for december"
3. try another simple alias, for example SAMPLE or TEST
Although I suspect that you do not show us the full request, and maybe there is a GROUP BY function that does not accept alias in this form, and therefore swears.
Since in a query with GROUP BY, GROUP BY first works, and then only SELECT, and because of this, GROUP BY does not see this alias.

I
Igor Kalashnikov, 2015-03-19
@zo0m

Or maybe you have a Cyrillic character there.
plus if count_for_december swears, replace it with c_f_d and tell me what will happen

E
Eugene, 2015-03-19
@ytyt

select 1 AS count_for_december from dual
Flight normal...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question