Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: SQL Server
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:
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 5-Sep-12 6:52am
Edited 5-Sep-12 6:56am
v2
Comments
Sandeep Mewara at 5-Sep-12 11:58am
   
Not clear. Please use the "Improve question" link to edit your question and provide better information.
ravi sharma11 at 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

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  

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

  Print Answers RSS
0 Dnyaneshwar@Pune 719
1 CHill60 315
2 Sergey Alexandrovich Kryukov 240
3 TheRealSteveJudge 190
4 Peter Leow 160
0 Sergey Alexandrovich Kryukov 9,193
1 OriginalGriff 6,786
2 Peter Leow 4,332
3 Zoltán Zörgő 3,809
4 Richard MacCutchan 2,672


Advertise | Privacy | Mobile
Web03 | 2.8.150128.1 | Last Updated 5 Sep 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100