Click here to Skip to main content
15,901,373 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi!
I have product page from where i select product and it redirect on product page.
I am get proper details after join but I have on product feature table. It have only
two fields. one is ProductId and other ProductFeatureId

I only want to get a single product with its all feature.

following is my query:
SQL
SELECT     p.ProductName, p.Detail, p.StartingDate, p.ClosingDate, p.BidPrice, p.BidIncrement, p.Model, p.ProductImage, p.RegisterNo, p.IsAvailable, p.Status, 
                      c.CityName, com.CompanyName, s.StateName, cn.CountryName
FROM         tblProduct AS p LEFT OUTER JOIN
                      tblCategory AS cat ON p.CategoryId = cat.CategoryId LEFT OUTER JOIN
                      tblCompany AS com ON p.CompanyId = com.CompanyId LEFT OUTER JOIN
                      tblCity AS c ON p.CityId = c.CityId LEFT OUTER JOIN
                      tblState AS s ON c.StateId = s.StateId LEFT OUTER JOIN
                      tblCountry AS cn ON s.CountryId = cn.CountryId

and still these table join remaining:
ProductFeature-------> ProductId,FeatureId
FeatureId     ------->  FeatureId,FeatureName

How can i join it
Posted
Updated 5-Sep-12 5:56am
v2
Comments
Sandeep Mewara 5-Sep-12 11:58am    
Not clear. Please use the "Improve question" link to edit your question and provide better information.
ravi sharma11 10-Sep-12 1:55am    
Thanks sandip, I have solved that issue. I have taken seprate datatable and fetch by product id and bind lable with the text....

1 solution

SELECT p.ProductName, p.Detail, p.StartingDate, p.ClosingDate, p.BidPrice, p.BidIncrement, p.Model, p.ProductImage, p.RegisterNo, p.IsAvailable, p.Status,
c.CityName, com.CompanyName, s.StateName, cn.CountryName
FROM tblProduct AS p,tblCategory AS cat,tblCompany AS com,tblCity AS c,
tblState AS s,tblCountry AS cn INNER JOIN
ON p.CategoryId = cat.CategoryId INNER JOIN
ON p.CompanyId = com.CompanyId INNER JOIN
ON p.CityId = c.CityId INNER JOIN
ON c.StateId = s.StateId INNER JOIN
ON s.CountryId = cn.CountryId
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900