I am trying to create a view for the following query.
SELECT DISTINCT
products.pid AS id,
products.pname AS name,
products.p_desc AS descri
You might want to swith the order of userid and location in the second select. The column names should match 1 to 1 in all selects of the union.
EDIT : For query browser , as this points out "To create a view from a query, you must have executed the query successfully. To be more precise, the view is created from the latest successfully executed query, not necessarily from the query currently in the Query Area"
so you need to execute the query first before you create the view in query browser.
The error is from the query browser and not mysql.