The case statement oracle instance

2010-08-09  来源:本站原创  分类:Database  人气:125 

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
相关文章
  • The case statement oracle instance 2010-08-09

    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%'

  • RHEL5 opening and closing and self-starting oracle instance 2010-06-11

    Start the database instance, is divided into two steps: first, start listening; the second step, start the database instance. First, how to start the database instance 1. Enter into sqlplus start instance [Oracle @ redhat ~] $ su - oracle - "switch t

  • [Turn] the process of multi-process oracle instance the role of the background process 2010-12-16

    1, DBWR process: the process of implementation of the buffer to write data files, is responsible for the management of the buffer memory an Oracle background process. A buffer when the buffer is modified, it is marked as "dirty", DBWR's main tas

  • oracle instance memory (SGA and PGA) to adjust 2011-08-30

    A Glossary (1) SGA: System Global Area is an essential component of Oracle Instance, allocated at instance startup; system-wide local SGA consists of three parts: the shared pool, the data buffer, the log buffer. (2) Shared Pool: Shared Pool is used

  • Common statement oracle database management 2010-03-29

    1. Delete users and their users all the objects below drop user branch cascade; 2. Remove the table space and table space, all the contents of drop tablespace center INCLUDING CONTENTS; 3. Remove the table space at the same time remove the foreign ke

  • Transfer of case out Oracle row 2010-04-27

    Extracts from: http://www.eygle.com/archives/2006/09/use_any_function.html Transfer of case out Oracle row 2009-08-04 23:45 database query will inevitably change the situation encountered in the ranks, pick out some of the more classical solutions --

  • oracle instance and database 2010-05-26

    1, "examples" (instance) and the "database" (database) defined. ORACLE instance = process + process using the memory (SGA) Instance is a temporary thing, you can believe it represents the state of the database at some point. Database =

  • Oracle Instance in the difference between instance and database 2010-07-14

    What is a database, is very simple, the database is a data storage medium. Is a commonly used files such as, in Oracle10G, the data storage has several. The first is a file format, which is created in your disk group files and then store the informat

  • ORACLE instance the difference between the database 2010-08-30

    People new to ORACLE instance and the database will certainly puzzled by the representative examples in the end what? Why the emergence of this concept? ORACLE instance = process + process using the memory (SGA) Instance is a temporary thing, you can

  • PL / SQL, use CASE statement 2010-10-13

    Although the CASE structure is basically not given any new semantics, but they do accept a more concise representation, and representation with respect to IF structure in terms of eliminating some duplication. See the table below to determine the sta

  • Oracle instance in contrast the difference between truncate and delete 2011-05-29

    Oracle instance in contrast the difference between truncate and delete Delete data in the table methods are delete, truncate, They are all deleted data in the table, not delete the table structure, delete the data you can delete the entire table can

  • Oracle instance in contrast to the difference between truncate and delete 2011-05-29

    Oracle instance in contrast to the difference between truncate and delete Delete data in the table methods are delete, truncate, They are deleted from the table of data, table structure can not be deleted, delete the data you can delete the entire ta

  • Linux change the sid and the dbname database oracle instance view 2011-06-15

    Sometimes we need to modify the database sid and dbname, in addition to using rman backup recovery, but also can be modified by hand, mainly done by two main processes: 1, modify the instance name (SID) 2, modify the database name (dbname) The follow

  • OracleDBA way of Oracle Instance (VI) 2011-08-31

    Oracle closed database (continued) shutdown normal | immediate | transactional In the closing process: The data cache data to disk file was not submitted things start to roll back the process of releasing resources: No instance recovery normal mode:

  • OracleDBA way of Oracle Instance (g) 2011-08-31

    <br /> Diagnostic information about the database file information in a way. Instance is also a management tool. Can better carry out the daily management of database, used to solve the problem, including the emergence of important events that have 3

  • sql language has no such C language switch case statement?? case 2010-06-22

    sql language has no such C language switch case statement? ? No, with the case when instead of on the line. For example, the following statement shows the Chinese years select getdate () as date, case month (getdate ()) when 11 then '11' when 12 then

  • Linux, delete the oracle instance 2010-06-28

    Two days ago, a remote oracle instance of reconstruction problems encountered in the process, record the following: 1, vnc common errors encountered [Root @ db1 bdump] # vncserver You will require a password to access your desktops. Password: Verify:

  • Scala study notes _3 case statement and the partial function 2010-07-04

    Scala provided through the case statement is simple and powerful pattern matching capabilities. But maybe you do not know, Scala also has a case statement related language features, that is: in the Scala, was "()" contains a series of case state

  • Function object as the conditions of case statement 2010-12-31

    Ruby 1.9's call Proc # === as an alias, so the function object can be used as conditions in the case statement def multiple_of(factor) lambda{|num| num % factor == 0} end #or #def multiple_of(factor) # proc{|num| num % factor == 0} #end # while numbe

  • View hibernate in the case statement caching 2011-01-09

    hibernate in the case statement caching: Need to hibernate to confirm its statistical functions. -------------------- Reference: AFAIK, Hibernate transforms all sql to prepared statement form before issuing it to the database. When tuning the applica