SELECT
id,
[stripHTML-title],
product_type,
price,
brand,
link,
[stripHTML-description],
image_ink,
condition
FROM
(
SELECT
ROW_NUMBER() over( order by p.ProductCode) as rownr,
p.ProductCode AS id
,p.ProductName AS [stripHTML-title]
,IsNull(pe.Google_Product_Type,'n/a') AS product_type
,IsNull(pe.SalePrice,pe.ProductPrice) AS price
,IsNull(pe.ProductManufacturer,'n/a') AS brand
,'Config_FullStoreURLProductDetails.asp?ProductCode=' + p.ProductCode + '&click=2&source=googlebase' AS link
,pd.ProductDescription AS [stripHTML-description]
,'Config_FullStoreURL?' + p.ProductCode + '-2.jpg' AS image_ink
,pe.ProductCondition AS condition
FROM
Products p
INNER JOIN Products_Descriptions pd
ON p.ProductID = pd.ProductID
INNER JOIN Products_Extended pe
ON pd.ProductID = pe.ProductID
WHERE
(p.IsChildOfProductCode is NULL OR p.IsChildOfProductCode = '')
AND (p.HideProduct is NULL OR p.HideProduct <> 'Y')
AND (pe.ProductPrice > 0)
) q
where q.rownr between 65001 and 130000
ORDER BY
q.id
|