title: SQL query to find active employees
body: <p>Sql query to find the active employees. sort the output in descending order based on employee id column and fetch only the first 15 records.
  Display employee id, employee name, city, state, country,salary, active date, status, department name, manager name.
  employee name: concatenate firstname &amp; lastname with space character and fetch only first 10 letters from employee name
  manager name: display firstname and lastname(separated by space)</p>
  <p>Tables:</p>
  <ul>
  <li>EMPLOYEE--dept_id,emp_activefrom, emp_dob, emp_fname, emp_lname, emp_sal, emp_status, emp_terminationdate, loc_id, mgr_id</li>
  <li>LOCATION-- city, country, loc_id, state</li>
  <li>DEPARTMENT--dept_head,dept_id, dept_name</li>
  </ul>
  <p>the below given is the code which i used,</p>
  <pre><code>SELECT b.* FROM (SELECT e.emp_id, SUBSTR(e.emp_fname||' '||e.emp_lname,1,10) AS emp_name, l.city, l.state, l.country, e.emp_sal, e.emp_activefrom, e.emp_status,d.dept_name, d.dept_head  FROM employee e, location l, department d WHERe e.dept_id=d.dept_id AND e.loc_id=l.loc_id AND e.emp_status='Active' ORDER BY 1 desc) b WHERE rownum&lt;=15;
  </code></pre>
  <p>I dont know what is wrong here. please help me out to solve this.</p>