Why my first select query shows error at 'AS' when the second one is ok? - oracle sql - error message: SQL command not properly ended
Asked
Active
Viewed 60 times
0
-
Welcome to Stack Overflow. Please always provide source code, error messages and other textual information as inline plain text rather than external pictures. Text is searchable, reusable and normally easier to read. – Álvaro González Feb 25 '19 at 07:36
-
if you just remove the bracket from the first query it may work. – bhavesh27 Feb 25 '19 at 07:37
-
@bhavesh27, I've tried, it doesn't. Still 'SQL command not properly ended' error message pop up – Shahril Feb 25 '19 at 07:41
-
@ÁlvaroGonzález, sorry..noted on that – Shahril Feb 25 '19 at 07:42
-
https://stackoverflow.com/questions/8451195/is-the-as-keyword-required-in-oracle-to-define-an-alias – bhavesh27 Feb 25 '19 at 07:43
1 Answers
2
Oracle does not allow as
in table level alias. It's allowed for column and subquery, that's why you don't get the error for the second example.
Fix it by removing as
like below:
select * from cisa xxxx

APC
- 144,005
- 19
- 170
- 281

Zaynul Abadin Tuhin
- 31,407
- 5
- 33
- 63
-
-
-
-
@Shahril - this answer shows you how to alias a table - you literally just omit the `as` keyword. – APC Feb 25 '19 at 07:44