0
我在Oracle中有以下sql查询。我如何循环查询?
SELECT pr.uuid AS masterproductid,
(case
when xmltype(pr.attributes_de_de).extract('//attr[@name = "SellingPoint1"]/string/text()') IS NOt NULL THEN 'sellingpoint1'
when xmltype(pr.attributes_de_de).extract('//attr[@name = "SellingPoint2"]/string/text()') IS NOt NULL THEN 'sellingpoint2'
END
) as testt
FROM product pr WHERE pr.defaultproductvariationid =(SELECT prv.uuid FROM productvariation prv WHERE prv.uuid = '3rep_vEBP6IAAAE83REjnPbb' AND pr.typecode='16')
在这种情况下,当两个“sellingpoint1”和“sellingpoint2”不为空,但此查询只返回sellingpoint1,我想“sellingpoint2”我还怎么能得到呢?
感谢您的帮助
你想在一列两个值? – 2013-02-22 13:34:33
不,我想在两列中的值 – user964147 2013-02-22 13:35:08
但是,然后你的查询应该总是返回3列。只需在同一个“CASE”中使用2个不同的'CASE'语句,而不是2个条件。 – 2013-02-22 13:37:11