title: Creating MySQL View using UNION
body: <p>I am trying to create a view for the following query.</p>
  
  <pre><code>SELECT DISTINCT
    products.pid        AS id,
    products.pname      AS name,
    products.p_desc     AS description,
    products.p_loc      AS location,
    products.p_uid      AS userid,
    products.isaproduct AS whatisit
  FROM products
  UNION
  SELECT DISTINCT
    services.s_id       AS id,
    services.s_name     AS name,
    services.s_desc     AS description,
    services.s_uid      AS userid,
    services.s_location AS location,
    services.isaservice AS whatisit
  FROM services
  </code></pre>
  
  <p>But not able to do so. I am using MySql query browser. The error I am getting is: </p>
  
  <blockquote>
    <p>A view can only be created from an active resultset of SELECT command</p>
  </blockquote>
  
  <p>Can someone please help me with this?</p>