直接上代码:
SELECT
IS_CLOUD_PAY_FAVOUR,CREDIT_TIME, CASE
WHEN nvl(IS_CLOUD_PAY_FAVOUR,'N') = 'N' and nvl(IS_AVOID_PIN_FAVOUR,'N') = 'N' THEN
'N'
WHEN nvl(IS_CLOUD_PAY_FAVOUR,'N') = 'Y' or nvl(IS_AVOID_PIN_FAVOUR,'N') = 'Y' THEN
'Y'
else concat( IS_CLOUD_PAY_FAVOUR,IS_AVOID_PIN_FAVOUR) end IS_CLOUD_PAY_AVOID_PIN_FAVOUR
FROM pos_order ORDER BY CREDIT_TIME DESC