title: MySQL Unique Identifiers on Column Names of UNION Query
body: <p>I have two different tables that share an 'is_featured' column. I need to select all content that is checked 'is_featured' and sort the results by 'date_display' desc. </p>
  
  <pre><code>            PHOTOS
  
              item_name  |  date_display  |  is_featured
              photo1     |  01-02-13      |  yes
              photo2     |  02-12-13      |  yes
              photo6     |  06-24-12      |  no
              photo23    |  09-24-12      |  no
  
              VIDEOS
  
              item_name  |  date_display  |  is_featured
              video5     |  01-14-13      |  no
              video10    |  03-09-13      |  no
              video30    |  03-21-13      |  yes
              video17    |  11-14-12      |  yes
  
  
              DESIRED RESULTS - All FEATURED CONTENT Sorted by Date DESC
  
              item_name  |  date_display  |  is_featured
              video30    |  03-21-13      |  yes
              photo2     |  02-12-13      |  yes
              photo1     |  01-02-13      |  yes
              video17    |  11-14-12      |  yes
  </code></pre>
  
  <p>I'm able to get my desired result with this UNION query:</p>
  
  <pre><code>            SELECT *
              FROM (SELECT item_name, date_display
              FROM photos
              WHERE is_featured='yes'
              UNION
              SELECT item_name, date_display
              FROM videos
              WHERE is_featured='yes'
              ) x
              ORDER BY date_display DESC
  </code></pre>
  
  <p>What I need now is to be able to add unique identifiers to the item_names of each table. For examples: photos.item_name and videos.item_name. </p>
  
  <p>Is that possible with the query I have? </p>
  
  <p>I ultimately need to do something like the following:
  If (item_name is from Photos table) { do this } </p>