title: how to return alternative columns on join
body: <p>I have a table with a list of functionalities for my site. Say it has three columns:</p>
  
  <pre><code>id_usr - url - landing_page
  1        a.php  a.html
  2        b.php  b.html
  3        c.php  c.html
  4        d.php  d.html
  </code></pre>
  
  <p>Then I have a table where for each user i have those functionalities he can display:</p>
  
  <pre><code>id_usr - func
  1         1
  1         3
  </code></pre>
  
  <p>My query selects those functionalities that the user is allowed to see and returns their url. So with the sample data it returns </p>
  
  <blockquote>
    <p>a.php, c.php</p>
  </blockquote>
  
  <p>And this is correct. The query is:</p>
  
  <pre><code>SELECT titolo, descr1,descr2, url, url_opz
  FROM `funzioni` JOIN funz_abilitate ON funz_abilitate.id_funzione=id
  WHERE funz_abilitate.id_user = $id
  </code></pre>
  
  <p>I am wondering how to improve my query to return the landing page for the functionalities that are not authorized. So the result should be:</p>
  
  <blockquote>
    <p>a.php, b.html, c.php, d.html</p>
  </blockquote>
  
  <p>So for those pages that are not in range for the user, instead of url, return the value of the landing_page column.</p>
  
  <p>How do I go on this with mysql 5.7?
  Edited to make the columns more readible</p>