title: MySql Statement to Select Based On a Column in Intermediate Table
body: <p>In a database, I have a username table and I have jurisdiction table. I also have a intermediate table to assign a user to one or more jurisdictions.</p>
  
  <p><strong>employee table</strong></p>
  
  <ul>
  <li>userID (primary Key)</li>
  <li>firstName</li>
  <li>lastName</li>
  </ul>
  
  <p>records:</p>
  
  <pre><code>+--------+-----------+----------+
  | userID | firstName | lastName |
  +--------+-----------+----------+
  |      6 | John      | Doe      |
  |     11 | lisa      | lopez    | 
  +--------+-----------+----------+
  </code></pre>
  
  <p><strong>jurisdictions table</strong></p>
  
  <ul>
  <li>jurId (Primary Key)</li>
  <li>region</li>
  </ul>
  
  <p>records:</p>
  
  <pre><code>+-------+--------------+
  | jurID | jurisdiction |
  +-------+--------------+
  |     1 | California   |
  |     2 | Texas        |
  |     3 | Washington   |
  |     4 | South Dakota |
  |     5 | Alaska       |
  |     6 | Ohio         |
  +-------+--------------+
  </code></pre>
  
  <p><strong>user_jurisdiction</strong></p>
  
  <ul>
  <li>userID (Foriegn Key pointing to employees userID)</li>
  <li>jurID  (Foriegn Key pointing to jurisdictions jurID)</li>
  </ul>
  
  <p>records:</p>
  
  <pre><code>    +--------+-------+
      | userID | jurID |
      +--------+-------+
      |      6 |     2 |
      |      6 |     3 |
      |     11 |     2 |
      +--------+-------+
  </code></pre>
  
  <p>I've been trying for hours to come up with a sql statement that would select/list all the workers from "Texas". I've been using many altercations of this sql statement but no success:</p>
  
  <pre><code>SELECT  jurisdictions.jurisdiction,
          employees.firstName
  FROM    jurisdictions,
          employees
          INNER JOIN user_jurisdictions
              ON  user_jurisdictions.jurID = jurisdictions.jurID AND 
                  user_jurisdictions.userID = employees.userID
  WHERE   jurisdictions.jurisdiction = "Texas";
  </code></pre>
  
  <p>But I have had no success. What sql statement would get a list of employees that are involved from jurisdictions.jurisdiction = "Texas";</p>