title: ORA-00904: invalid identifier in this instance
body: <p>Here is my solution, I want to display  all the information in 3 tables with salary, when I put salary at then end, no matter what I tried,I still got wrong. Someone help me fix. I don't know how to display the salary with only 15 rows.</p>
  
  <pre><code>SELECT Bld.id,C.code,M.FIRST_NAME,M.LAST_NAME,Bld.Address,M.ADDRESS,D.DOB,S.SALARY
      from HW1_PERSON M
      inner join HW1_BUILDING Bld
      ON M.id = Bld.id
      INNER JOIN HW1_PERSON M 
      ON Bld.id = M.id
      INNER JOIN HW1_PERSON M 
      ON M.id = Bld.id
      Inner JOIN HW1_BUILDING Bld
      ON Bld.id = M.id
      INNER JOIN HW1_BUILDING C
      ON M.id = C.id
      INNER JOIN HW1_PERSON D
      ON M.id = D.id
      UNION ALL
      SELECT Bld.id,C.code,M.FIRST_NAME,M.LAST_NAME,Bld.Address,M.ADDRESS,D.DOB,S.SALARY FROM HW1_STAFF S
      where S.SALARY = NULL
      ;
  </code></pre>
  
  <hr>
  
  <p>Here are the tables </p>
  
  <pre><code>CREATE TABLE HW1_PERSON (
       ID INT NOT NULL,
       FIRST_NAME VARCHAR(32) NOT NULL,
       LAST_NAME VARCHAR(32) NOT NULL,
       DOB DATE,
       ADDRESS VARCHAR2(32),
       CONSTRAINT PK_HW1_PERSON_ID PRIMARY KEY (ID));
  
  CREATE TABLE HW1_STAFF (
       SALARY DOUBLE PRECISION NOT NULL,
       START_DATE DATE NOT NULL,
       END_DATE DATE DEFAULT NULL,
       EMP_NUM VARCHAR(5) NOT NULL UNIQUE,
       PERSON_ID INT NOT NULL,
       CONSTRAINT PK_HW1_STAFF PRIMARY KEY (PERSON_ID),
       CONSTRAINT FK_STAFF_PERSON FOREIGN KEY(PERSON_ID) REFERENCES HW1_PERSON(ID));
  
  CREATE TABLE HW1_BUILDING (
       ID INT NOT NULL,
       CODE VARCHAR2(5) NOT NULL UNIQUE,
       NAME VARCHAR2(32) NOT NULL,
       ADDRESS VARCHAR2(32),
       MANAGER_ID INT,
       CONSTRAINT PK_HW1_BUILDING PRIMARY KEY (ID),
       CONSTRAINT FK_BUILDING_STAFF FOREIGN KEY(MANAGER_ID) REFERENCES HW1_STAFF(PERSON_ID));
  
  CREATE TABLE HW1_EMPLOYEE (
       ID INT NOT NULL,
       PERSON_ID INT,
       BUILDING_ID INT,
       CONSTRAINT PK_HW1_EMPLOYEE PRIMARY KEY (PERSON_ID,BUILDING_ID),
       CONSTRAINT FK_STAFF_ID FOREIGN KEY(PERSON_ID) REFERENCES HW1_STAFF(PERSON_ID),
       CONSTRAINT FK_BUILDING_ID FOREIGN KEY(BUILDING_ID) REFERENCES HW1_BUILDING(ID));
  </code></pre>
  
  <hr>
  
  <p>DATA EXAMPLE</p>
  
  <pre><code>INSERT INTO hw1_person (id, first_name, last_name, dob, address) VALUES (1, 'fname11', 'lname11', to_date('7/27/1990', 'MM/DD/YYYY'), '527 15th Av CT');
  INSERT INTO hw1_person (id, first_name, last_name, dob, address) VALUES (2, 'fname12', 'lname12', to_date('12/5/1966', 'MM/DD/YYYY'), '254 11th St CT');
  
  
  INSERT INTO hw1_staff (person_id, emp_num, start_date, end_date, salary) VALUES (1, 'WZIAE', to_date('7/1/1965', 'MM/DD/YYYY'), null,70000);
  INSERT INTO hw1_staff (person_id, emp_num, start_date, end_date, salary) VALUES (2, 'EWEMU', to_date('11/18/1980', 'MM/DD/YYYY'), to_date('12/26/1970', 'MM/DD/YYYY'),80000);
  INSERT INTO hw1_staff (person_id, emp_num, start_date, end_date, salary) VALUES (25, '00001', to_date('5/21/1994', 'MM/DD/YYYY'), null,0);
  INSERT INTO hw1_staff (person_id, emp_num, start_date, end_date, salary) VALUES (26, '00002', to_date('7/19/1985', 'MM/DD/YYYY'), null,0);
  </code></pre>