Search code examples
sqloracle-databaseapex

ORA-00911: invalid character ??///


i am trying to execute this query but i am getting ORA-00911: invalid character

SELECT e.empno AS “Employee ID”, e.ename AS “Employee Name”, d.deptno AS “Dept No”, 
d.dname AS “Dept Name”, d.loc AS “Dept Location” FROM emp e, dept d WHERE e.deptno = d.deptno AND e.deptno = 10;

Solution

  • SELECT e.empno AS "Employee ID", 
    e.ename AS "Employee Name",
    d.deptno AS "Dept No", 
    d.dname AS "Dept Name", 
    d.loc AS "Dept Location" 
    FROM emp e, dept d WHERE e.deptno = d.deptno AND (e.deptno = 10);
    

    Your double quotes are wrong. Change the quotes.

    And just saying it has nothing to with error AS keyword is optional you can write column aliases like this

    e.ename "Employee Name"
    

    In my opinion, it is also readable but yes depends on individuals choice.