title: SELECT Column_B FROM tableA where Column_A = ? AND SELECT Column C from tableB where Column B = Column B from table 1?
body: <p>So I have a database with two tables in it.</p>
  <p><strong>dept_emp table:</strong></p>
  <pre><code>emp_no | dept_no
  ----------------
  001    | 008
  002    | 006
  etc.   | etc.
  </code></pre>
  <p><strong>departments table:</strong></p>
  <pre><code>dept_no | dept_name
  --------------------
  d001    | Customer Service
  d002    | Development
  etc.    | etc.
  </code></pre>
  <p>In my API I'd like to build a single request to the database that can combine both of these lines of code:</p>
  <pre><code>&quot;SELECT dept_no FROM dept_emp WHERE emp_no = ?&quot; 
  </code></pre>
  <p>then</p>
  <pre><code>&quot;SELECT dept_name FROM departments WHERE dept_no = (the previously grabbed dept_no)&quot;
  </code></pre>
  <p>I know how to do things similar (but less complicated) than this in one query with JOIN and HAVING, but syntax is giving me a hard time here. Any advice is appreciated.</p>