This is my query
SELECT Id, productName, Largeimagepath, Discount, Price, Image FROM tablename1 where Active =1
union
SELECT Id, productName, Largeimagepath, Discount, Price, Image FROM tablename2 where Active =1
union
SELECT Id, productName, Largeimagepath, Discount, Price, Image FROM tablename3 where Active =1
It is working properly.
Now I want to fetch the table name for the respective productName in future.
- So how can I fetch it?
I tried AS.. like this:
SELECT Id, productName, Largeimagepath, Discount, Price, Image
FROM tablename3 AS tablename
where Active = 1;
but didn't get output.
- How shall I correct the query and also Improve the performance of query?