oracle的case语句实例

 
SELECT 
    SUM(
 CASE
        WHEN s.SFDC_Opportunity_Id     IS NOT NULL
        AND s.Converted_To_Opportunity IS NOT NULL
        THEN 1
        ELSE 0
      END
      ) AS total_opportunities,
      SUM(
      CASE
        WHEN LOWER(s.Opportunity_Status ) LIKE '%close%'
        AND ( LOWER(s.Opportunity_Status ) LIKE '%win%'
        OR LOWER(s.Opportunity_Status ) LIKE '%won%' )
        THEN 1
        ELSE 0
      END
      ) AS total_wins
    FROM test

   

你可能感兴趣的:(java,oracle)