Reputation: 21
I have the following query:
select
name, description
from tblproducts
right join tblproductssales
on tblproducts.ID = tblproductssales.Product_ID
How can I get the same retreived data using subquery?
Upvotes: 0
Views: 66
Reputation: 1464
SELECT
(SELECT name FROM tblproducts WHERE ID = A.ProductID) AS name,
(SELECT description FROM tblproducts WHERE ID = A.ProductID) AS description
FROM tblproductssales A
Upvotes: 2