給出以下顯示的SQL語句。如果我改變了線以下(刪除「」在-2.jpg)然後我得到返回的完整鏈接我不明白在這行代碼在sql中結合文本我想?
, 'http://www.thesite.com/v/vspfiles/photos/' + IsNull(p.Vendor_PartNo,p.ProductCode) + '-2.jpg' AS image_link
返回的「圖片鏈接」什麼(前綴和後綴),但顯然沒有「。」
, 'http://www.thesite.com/v/vspfiles/photos/' + IsNull(p.Vendor_PartNo,p.ProductCode) + '-2jpg' AS image_link
什麼是錯的,我怎麼能包括「。」在後綴?
SELECT p.ProductCode AS id
, p.ProductName AS title
, 'Home & Garden > Household Appliance Accessories > Laundry Appliance Accessories' AS product_type
, IsNull(pe.SalePrice,pe.ProductPrice) AS price
, IsNull(pe.ProductManufacturer,'n/a') AS brand
, IsNull(pe.ProductCondition,'new') AS condition
, CONVERT(VARCHAR(10), (GETDATE() + 30),120) AS expiration_date
, pd.ProductDescriptionShort AS [stripHTML-description]
, 'http://www.thesite.com/v/vspfiles/photos/' + IsNull(p.Vendor_PartNo,p.ProductCode) + '-2.jpg' AS image_link
, 'http://www.thesite.asp?ProductCode=' + p.ProductCode + '&Click=1327' AS link
, CAST(pe.ProductWeight AS VARCHAR(20)) + ' lb' AS weight
FROM Products p
JOIN Products_Descriptions pd ON p.ProductID = pd.ProductID
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
ORDER BY p.ProductCode
字符串連接的供應商而異。你使用的是哪個數據庫? MySQL,PostgreSQL,SQLite3,Oracle,MS SQL Server? – SingleNegationElimination
我相信服務器是MS SQL服務器 – user357034