我正在尝试以英语和俄语显示数据
SELECT temp.*
FROM (SELECT DISTINCT CASE WHEN pd.LANGUAGE_ID = 'US' THEN COALESCE(TO_CHAR(pd.TRANSLATED_NAME), ' ')
END AS PRODUCT_NAME_US,
CASE WHEN pd.LANGUAGE_ID = 'US' THEN CONCAT(SUBSTR(pd.TRANSLATED_DESCRIPTION, 1, 30), '...')
END AS PRODUCT_DESC_US,
CASE WHEN pd.LANGUAGE_ID = 'RU' THEN COALESCE(TO_CHAR(pd.TRANSLATED_NAME), ' ')
END AS PRODUCT_NAME_RU,
CASE WHEN pd.LANGUAGE_ID = 'RU' THEN CONCAT(SUBSTR(pd.TRANSLATED_DESCRIPTION, 1, 30), '...')
END AS PRODUCT_DESC_RU,
CASE WHEN pin.WARRANTY_PERIOD = '00-00' THEN 'No Warranty'
WHEN EXTRACT(MONTH FROM pin.WARRANTY_PERIOD) = '00' THEN EXTRACT(YEAR FROM pin.WARRANTY_PERIOD) || ' years'
WHEN EXTRACT(YEAR FROM pin.WARRANTY_PERIOD) = '00' THEN EXTRACT(MONTH FROM pin.WARRANTY_PERIOD) || ' months'
WHEN EXTRACT(MONTH FROM pin.WARRANTY_PERIOD) <> '00' AND EXTRACT(YEAR FROM pin.WARRANTY_PERIOD) <> '00'
THEN EXTRACT(YEAR FROM pin.WARRANTY_PERIOD) || ' years and ' || EXTRACT(MONTH FROM pin.WARRANTY_PERIOD) ||' months'
ELSE 'No Warranty'
END AS "Warranty", inv.QUANTITY_ON_HAND AS IN_STOCK
FROM PRODUCT_DESCRIPTIONS pd JOIN PRODUCT_INFORMATION pin
ON pd.PRODUCT_ID = pin.PRODUCT_ID
JOIN INVENTORIES inv
ON inv.PRODUCT_ID = pin.PRODUCT_ID) temp
WHERE temp.PRODUCT_NAME_US LIKE '%Monitor%'
OR temp.PRODUCT_NAME_RU LIKE '%Монитор%'
AND temp.IN_STOCK < 1000
ORDER BY temp.PRODUCT_NAME_US ASC, temp."Warranty" DESC;
,但结果包括零值。我该如何删除它们?
在此处输入图像描述
尝试通过移动
其中temp.product_name_us喜欢'%monitor%'或temp.product_name_ru喜欢'%聚醚Ö。
内部查询并在外部查询中使用coce