garethtnash
asked on
My Select Statement is resulting in duplicate records being produced...
Help,
My Select Statement is resulting in duplicate records being produced...
Think it may be something to do with my joins????
Thank you
My Select Statement is resulting in duplicate records being produced...
Think it may be something to do with my joins????
Thank you
Select
P.ID,
P.[Product-Name],
LEFT(P.[Product-Description],40)+'..' AS Description,
Case When P.[Display-TGI-Special-Price]='Y' then DP.[Special-Price] Else DP.[Normal-Price] end AS Price,
Case When P.[Display-TGI-Special-Price]='Y' then DP.[Normal-Price] end AS OriginalPrice,
I.Image,
P.SKUCode
from dbo.[Direct-Product] P
inner join dbo.[Direct-Product-Image] I on I.ProductID = P.ID
inner join dbo.[Direct-Product-Price] DP on DP.[Product-ID] = P.ID
left join dbo.[Direct-Product-Category] DPC on DPC.[Product-ID] = P.ID
left join dbo.[Direct-Category] C on C.ID = DPC.[Category-ID]
inner join dbo.[Nominal-Codes] NC ON P.NominalCodeID = NC.ID
Where (C.[Category-label] LIKE 't' OR P.[Product-Name] LIKE 't' OR P.SKUCode LIKE 't'
OR P.[Product-Description] LIKE 't')
AND P.StockCount >= 1 AND P.[Display-TGI-Direct] = 'Y'
AND I.[Default-Image] = 'Y'
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER