I need to do a report based on 6 ticket tables and a product table (for the product description). Here is what I have tried: (I am only using 2 ticket files for this illustration)
select ticket1.*, products.description as productname
from ticket1, products
where ticket1.productid = products.productid
union all
select ticket2.*, products.description as productname
from tickets2, products
where ticket2.productid = products.productid
I get a non-unique table reference on products when I try to execute the query. What is the best way to accomplish what I am trying to do?
select ticket1.*, products.description as productname
from ticket1, products
where ticket1.productid = products.productid
union all
select ticket2.*, products.description as productname
from tickets2, products
where ticket2.productid = products.productid
I get a non-unique table reference on products when I try to execute the query. What is the best way to accomplish what I am trying to do?