I want to get a result from three tables. i dont how to write the sql query. Please help me. "I want to display Name,Username and Product_Name where Id=007" table "register" Name Username Id Arj arjun 007 xyz abcd 008 abcd asdf 007 table "products" Product_Id Product_Name Price 101 Clothes 200 102 Games 100 table "purchase" //products.Product_Id=purchase.Item Username item Id arjun 102 007 abcd 101 008 asdf 102 007
I am not sure, is it possible. but help me. THANKS IN ADVANCE
Use the following SQL query may this will helpful for you
SELECT r.Name,r.Username, p.Product_Name
FROM register r, products p,purchase pr
WHERE r.id=7 AND r.Username = pr.Username AND p.ProductId = pr.ProductId
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.