现有查询语句如下:
Select f.ProductId,a.ProductDataId,a.code,a.Name
FROM dbo.D_Product a With(NoLock)
INNER JOIN D_ProductRelation f
ON a.ProductDataId = f.ProductDataId
AND a.[Type] IN(1,8) AND f.[Type] = 1
WHERE
a.code like '%AC%'
and
f.ProductId IN
(Select ProductId From V_CategoryProduct
WHERE SecondCategoryId = 181
);
Select f.ProductId,a.ProductDataId,a.code,a.Name, T_ProductNickelFreeImages.ImageUrl
FROM dbo.D_Product a With(NoLock)
INNER JOIN D_ProductRelation f
ON a.ProductDataId = f.ProductDataId
AND a.[Type] IN(1,8) AND f.[Type] = 1
INNER JOIN T_ProductNickelFreeImages
ON a.ProductDataId=T_ProductNickelFreeImages.ProductId
WHERE
a.code like '%AC%'
and
f.ProductId IN
(Select ProductId From V_CategoryProduct
WHERE SecondCategoryId = 181
);