Reputation: 3
SQL
I think that my join statement is incorrect:
select distinct product.ID,
product.externalid as 'Product ID',
product.productname as 'Product Name',
StaticSpec.StaticSpecGroupName as 'Static Spec Group Name',
StaticSpec.StaticSpecName as 'Static Spec Name',
StaticSpec.StaticSpecValue as 'Static Spec Value',
company.companyname as 'Buyer Site'
from Product
join StaticSpec on Product.id = staticspec.ProductID,
join Company on company.id = product.id
where Product.active = 'Yes'
In order to get the Company Name in the Query I created the above, but I cannot get it to display correctly and none of my notes are helping at all. Are there any SQL gurus out there that might be able to see what is incorrect?
Thanks so much in advance!
Upvotes: 0
Views: 44
Reputation: 6390
You're joining on companyid = productID - presumable not the same thing.
Upvotes: 1