title: Why can't I use a table's alias and its original name in the same query when two tables are joined?
body: <p>Assume there are two tables created by:</p>
  
  <pre><code>CREATE TABLE emp
  (
  EMPNO int,
  EMPNAME varchar(255),
  JOB varchar(255),
  DEPTNO int
  );
  
  CREATE TABLE dept
  (
  LOC varchar(255),
  DEPTNO int
  );
  </code></pre>
  
  <p>I want to find out what dept has no employ. I use a left join like this:</p>
  
  <pre><code>select dept.* 
  from dept  
  left join emp 
   on (dept.deptno=emp.deptno) 
  where emp.empno is null;
  </code></pre>
  
  <p>But if I use an alias for dept or emp, then I can only use alias and cannot use the original table name. For instance:</p>
  
  <pre><code>select dept.* 
  from dept as d 
  left join emp 
   on (dept.deptno=emp.deptno) 
  where emp.empno is null;
  </code></pre>
  
  <p>I get an error "no such table: dept" from sqlite.</p>
  
  <p>If I run operations on one table, I can use alias and the original table name in the same query.</p>
  
  <p>Anybody know why?  </p>